//
//  HWGameDetailsViewController.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/9/5.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWGameDetailsViewController.h"
#import "HWGamexiangQingTableViewCell.h"
#import "HWKaiFuTableViewCell.h"
#import "HWQCJiaoYiTableViewCell.h"
#import "HWFenXiangGameView.h"
#import "HWDetailsTopModel.h" // 游戏详情顶部
#import "HWLoginController.h" // 登录
#import "HWWebViewGameViewController.h"
#import "HWerweiMaFenXiangView.h"

#import <TencentOpenAPI/TencentOAuth.h>
#import <TencentOpenAPI/QQApiInterface.h>
#import <TencentOpenAPI/QQApiInterfaceObject.h>
#import "WXApi.h"
#import "HWlibaoxiangqingTableViewCell.h"

#import "HWlibaoxiangqingjiemianModel.h"


#import "HWpinglunjiemianQCTableViewCell.h"

#import <JXCategoryView.h>
#import "HWpingjiajiemianViewController.h" // 发布评价界面
#import "HWNewdetailsDaoView.h"
#import <JXPagingView/JXPagerView.h>
#import "PagingViewTableHeaderView.h"
#import "HWNewpingjiaView.h"
#import "HWevaluationshituView.h"
#import "HWjiaoyijiemianView.h"
#import "UIBarButtonItem+Item.h"

//#import <JWVIPSDK/JWVIPSDK.h>


//static const CGFloat JXTableHeaderViewHeight = 245 + 70;
static const CGFloat JXheightForHeaderInSection = 40;

@interface HWGameDetailsViewController ()<UITableViewDelegate,UITableViewDataSource,HWFenXiangGameViewDelegate,JXPagerViewDelegate, JXCategoryViewDelegate>
{
    
    CGFloat JXTableHeaderViewHeight ;
    SendMessageToQQReq *req;
    NSString *member_id; //推广id
    
}







//@property(strong,nonatomic) UITableView *mainaTableVie;
//@property(strong,nonatomic) UIView *hederView;
//
//// 这一块是那个卡片Uiview
//@property(strong,nonatomic) UIView *kaPianView; //游戏卡片
//@property(strong,nonatomic) UILabel *penfenlabel; // 评分
//@property(strong,nonatomic) UIImageView *touxiangimageView; // 头像
//@property(strong,nonatomic) UILabel *nameLabel;
//@property(strong,nonatomic) UILabel *contentLabel;
//@property(strong,nonatomic) NSMutableArray *biaoqiLabelMuArr;
//@property(strong,nonatomic) NSArray *shujuBiaoqianArr;
//@property(strong,nonatomic) UILabel *paiHangbangLabel; // 排行榜
//@property(strong,nonatomic) UILabel *xiazaiLabel; // 下载
//@property(strong,nonatomic) UILabel *wangguoleLabel; // 玩过了
//
////添加底部Uiview
//@property(strong,nonatomic)UIView *lowerPartView;
//// 这个用来判断
//@property(assign,nonatomic) int xuanzhongTag;
//@property(strong,nonatomic) UIButton *xuanzhongBut;
//@property(assign,nonatomic) BOOL zhangkai;
////开服测试数据
//@property(strong,nonatomic) NSArray *kaifuData;
//// 顶部模型
//@property(strong,nonatomic) HWDetailsTopModel *topModel;
//
////详情字典
//@property(strong,nonatomic) NSDictionary *xiangqngDic; // 详情字典
//@property(strong,nonatomic) UIButton *shouCangBut; // 收藏
//@property(strong,nonatomic) UIButton *downloadBut; // 下载按钮
//
//
//// 导航的三个控件
//@property(strong,nonatomic) UIView *daohaView;
//@property(strong,nonatomic) UIButton *fanhuiBut;
//@property(strong,nonatomic) UILabel *biatiuLabe;
//@property(strong,nonatomic) NSMutableArray  *libaoshujdataMuArr;
//
//// 评论接口
//@property(strong,nonatomic)NSMutableArray *commentsMutableArr;
//@property(assign,nonatomic) CGFloat pinglungaodu;
//
//@property(strong,nonatomic) NSMutableArray *cunchuArr;


@property(strong,nonatomic) UITableView *mainaTableVie;
@property(strong,nonatomic) UIView *hederView;

// 这一块是那个卡片Uiview
@property(strong,nonatomic) UIView *kaPianView; //游戏卡片
@property(strong,nonatomic) UILabel *penfenlabel; // 评分
@property(strong,nonatomic) UIImageView *touxiangimageView; // 头像
@property(strong,nonatomic) UILabel *nameLabel;
@property(strong,nonatomic) UILabel *contentLabel;
@property(strong,nonatomic) NSMutableArray *biaoqiLabelMuArr;
@property(strong,nonatomic) NSArray *shujuBiaoqianArr;
@property(strong,nonatomic) UILabel *paiHangbangLabel; // 排行榜
@property(strong,nonatomic) UILabel *xiazaiLabel; // 下载
@property(strong,nonatomic) UILabel *wangguoleLabel; // 玩过了

//添加底部Uiview
@property(strong,nonatomic)UIView *lowerPartView;
// 这个用来判断
@property(assign,nonatomic) int xuanzhongTag;
@property(strong,nonatomic) UIButton *xuanzhongBut;
@property(assign,nonatomic) BOOL zhangkai;
//开服测试数据
@property(strong,nonatomic) NSArray *kaifuData;
// 顶部模型
@property(strong,nonatomic) HWDetailsTopModel *topModel;

//详情字典
@property(strong,nonatomic) NSDictionary *xiangqngDic; // 详情字典
@property(strong,nonatomic) UIButton *shouCangBut; // 收藏
@property(strong,nonatomic) UIButton *downloadBut; // 下载按钮


// 导航的三个控件
@property(strong,nonatomic) UIView *daohaView;
@property(strong,nonatomic) UIButton *fanhuiBut;
@property(strong,nonatomic) UILabel *biatiuLabe;

@property(strong,nonatomic) NSMutableArray *cunchuArr;


//最新详情接口
@property(strong,nonatomic)UIView *toubuHeadView;
@property(strong,nonatomic)UIImageView *rankingImageView;
@property(strong,nonatomic)UILabel *rankingLabel;
@property(strong,nonatomic)UIImageView *zuixingicoimageview;
@property(strong,nonatomic)UILabel *mingchengLabel;
@property(strong,nonatomic)UILabel *daxiaojingeLabel;
@property(strong,nonatomic)UILabel *tuijianzhishuLabel;
@property(strong,nonatomic)UILabel *oneLabel;
@property(strong,nonatomic)UILabel *twoLabel;
@property(strong,nonatomic)UILabel *threeLabel;

@property(strong,nonatomic)UIImageView *pingfenImageView;
@property(strong,nonatomic)UILabel *zuixingscoreLabel;
@property(strong,nonatomic)NSMutableArray *storeStarsMuArr;
//开服和总label
@property(strong,nonatomic) UIView  *kaifubaiseView;
@property(strong,nonatomic)UILabel *kaifushijianLabel;


// 礼包Uiview 和 优惠券Uiview
@property(strong,nonatomic)UIView *zuixinglibaoView;
@property(strong,nonatomic)UIView *zuixingyouhuiquView;
//@property (nonatomic, strong) JXCategoryTitleView *categoryView;
@property (strong, nonatomic) JXCategoryListContainerView *listContainerView;
@property(strong,nonatomic)UIScrollView *scrollView;


@property (nonatomic, strong) JXPagerView *pagingView;
@property (nonatomic, strong) PagingViewTableHeaderView *userHeaderView;
@property (nonatomic, strong) JXCategoryTitleView *categoryView;
@property (nonatomic, strong) NSArray <NSString *> *titles;
@property (nonatomic,strong) HWNewdetailsDaoView *cunchuView;
@property(strong,nonatomic) HWNewpingjiaView *pingjianjiemianview;

@property(strong,nonatomic) UILabel *zhekouLabel;


@property(strong,nonatomic) UIImageView *groupBGView;
@property(strong,nonatomic) UILabel *groupNameLabel;
@property(strong,nonatomic) UILabel *groupNewMessageLabel;
@property(strong,nonatomic) UILabel *joinGroupLabel;
@property(strong,nonatomic) UILabel *joinNumLabel;
@property(strong,nonatomic) UIView *huiseview;
@property(strong,nonatomic) UIButton *joinGroupButton;
@property(strong,nonatomic) NSString *groupUrl;

@property(strong,nonatomic) UIButton *openServiceListButton;
@end

@implementation HWGameDetailsViewController
-(UITableView *)mainaTableVie {
    
    if  (_mainaTableVie == nil) {
        
        _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight-3, kScreenW, kScreenH+StatusBarHeight-44-TabbarSafeBottomMargin) style:UITableViewStyleGrouped];
        // _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH-44) style:UITableViewStylePlain];
        _mainaTableVie.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
        _mainaTableVie.delegate = self;
        _mainaTableVie.dataSource = self;
        _mainaTableVie.separatorStyle = UITableViewCellSeparatorStyleNone;
        _mainaTableVie.backgroundColor = [UIColor whiteColor];
    }
    return   _mainaTableVie;
    
}


- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    //   [self.navigationController setNavigationBarHidden:YES animated:animated];
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    self.tabBarController.tabBar.hidden = YES;
    
    //  [self topGameDetails];
    [self.pingjianjiemianview  refreshData];
    [self.cunchuView refreshData];
    
    self.navigationController.navigationBarHidden = NO;
    
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    
    //   [self.navigationController setNavigationBarHidden:NO animated:animated]；
    
    [self.cunchuView  guanbibofan];
    
    
    
}






//
- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupNavigayion];
    [self setupUI];
    [self setuptongbuview];
    //  [self initUI];
    [self addLowerPartView];
    //  [self initFrame];
    [self topGameDetails];
    //  [self initUI];
    
    
}

- (void)setupUI{
    JXTableHeaderViewHeight = 245 + 70;
    _titles = @[@"详情", @"评价", @"开服",@"交易"];
    
    _userHeaderView = [[PagingViewTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, JXTableHeaderViewHeight)];
    
    _categoryView = [[JXCategoryTitleView alloc] init];
    
    self.categoryView.bounds = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, JXheightForHeaderInSection);
    self.categoryView.titles = self.titles;
    self.categoryView.backgroundColor = [UIColor whiteColor];
    self.categoryView.delegate = self;
    self.categoryView.titleSelectedColor = [UIColor colorWithRed:105/255.0 green:144/255.0 blue:239/255.0 alpha:1];
    self.categoryView.titleColor = [UIColor blackColor];
    self.categoryView.titleSelectedColor = RGB(247, 124, 47);
    self.categoryView.titleColorGradientEnabled = YES;
    self.categoryView.titleLabelZoomEnabled = YES;
    self.categoryView.titleLabelZoomEnabled = YES;
    
    JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
    lineView.indicatorColor = [UIColor colorWithRed:105/255.0 green:144/255.0 blue:239/255.0 alpha:1];
    lineView.indicatorWidth = 30;
    self.categoryView.indicators = @[lineView];
    lineView.indicatorColor=  RGB(247, 124, 47);
    
    _pagingView = [[JXPagerView alloc] initWithDelegate:self];
    [self.view addSubview:self.pagingView];
    
    self.categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
    
    self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0);
    
    //  self.pagingView.frame  = CGRectMake(0,0,  self.view.frame.size.width, self.view.frame.size.height-235 );
    //    [_pagingView mas_makeConstraints:^(MASConstraintMaker *make) {
    //        make.left.right.bottom.top.mas_equalTo(0);
    //    }];
    
}


- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
    
    //   self.pagingView.frame = self.view.bounds;
    //   self.pagingView.frame  = CGRectMake(0,0,  self.view.frame.size.width, self.view.frame.size.height );
    //    [self.pagingView mas_makeConstraints:^(MASConstraintMaker *make) {
    //        make.left.right.bottom.top.equalTo(0);
    //    }];
    
    self.pagingView.frame  = CGRectMake(0,NavBarHeight, kScreenW, kScreenH-TabbarSafeBottomMargin-60-NavBarHeight);
    
}





- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
    return self.userHeaderView;
}

- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
    return JXTableHeaderViewHeight;
}

- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
    return JXheightForHeaderInSection;
}

- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
    return self.categoryView;
}

- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView {
    return self.titles.count;
}

- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
    HWNewdetailsDaoView *list = [[HWNewdetailsDaoView alloc] init];
    list.gameId = self.gameId;
    
    if (index == 0) {
        //  list.dataSource = @[@"橡胶雷神象枪", @"橡胶攻城炮", @"橡胶象枪", @"橡胶象枪乱打", @"橡胶灰熊铳", @"橡胶雷神象枪", @"橡胶猿王枪", @"橡胶犀·榴弹炮", @"橡胶大蛇炮"].mutableCopy;
        HWNewdetailsDaoView *list1 = [[HWNewdetailsDaoView alloc] init];
        list1.gameId = self.gameId;
        self.cunchuView = list1;
        [list1 refreshData];
        return list1;
        
        
    }else if (index == 1) {
        // list.dataSource = @[@"吃烤肉", @"吃鸡腿肉", @"吃牛肉", @"各种肉"].mutableCopy;
        HWNewpingjiaView *pilu = [[HWNewpingjiaView alloc]init];
        pilu.gameId = self.gameId;
        self.pingjianjiemianview = pilu;
        [pilu refreshData];
        return  pilu;
        
        
        
        
    }else if (index == 2) {
        // list.dataSource = @[@"【音乐家】布鲁克", @"【考古学家】妮可·罗宾"].mutableCopy;
        HWevaluationshituView  *evalue= [[HWevaluationshituView alloc]init];
        evalue.gameId =self.gameId;
        [evalue refreshData];
        
        return  evalue;
        
        
        
    } else if (index == 3){
        
        HWjiaoyijiemianView *jiaoyi = [[HWjiaoyijiemianView alloc]init];
        jiaoyi.gameId=self.gameId;
        [jiaoyi refreshData];
        return jiaoyi;
        
    }
    
    
    
    return list;
}

- (void)mainTableViewDidScroll:(UIScrollView *)scrollView {
    [self.userHeaderView scrollViewDidScroll:scrollView.contentOffset.y];
}

#pragma mark - JXCategoryViewDelegate

- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
    
    
    
    self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
    
    
    
    
}



































// 游戏详情_ 顶部数据


// 设置导航栏
- (void)setupNavigayion {
    
    self.view.backgroundColor = RGB(240, 240, 240);
    self.navigationItem.title= @"游戏详情";
    //    self.toubuHeadView = [[UIView alloc]initWithFrame:CGRectMake(0, NavBarHeight, kScreenW, 235)];
    //    self.toubuHeadView.backgroundColor = RGB(255, 255, 255);
    //    [self.view addSubview:self.toubuHeadView];
    
    UIImage *loginImg = [UIImage imageNamed:@"fanxiangdeicotupian"];
    loginImg = [loginImg imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIButton *jiluBut = [UIButton buttonWithType:UIButtonTypeCustom];
    jiluBut.frame = CGRectMake(0, 0, 30, 44);
    jiluBut.backgroundColor = [UIColor clearColor];
    jiluBut.layer.cornerRadius = 2;
    // [jiluBut setTitle:@"记录" forState:UIControlStateNormal];
    [jiluBut addTarget:self action:@selector(fenxiangTap:) forControlEvents:UIControlEventTouchUpInside];
    [jiluBut setImage:loginImg forState:UIControlStateNormal];
    
    jiluBut.layer.masksToBounds = YES;
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:jiluBut];
    
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem  backItemWithimage:[UIImage imageNamed:@"fanhui"] highImage:[UIImage imageNamed:@"fanhui"] target:self action:@selector(back) title:@"   "];
    
}

- (void)back {
    
    [self.navigationController popViewControllerAnimated:YES];
}


// 设置
- (void)setuptongbuview {
    
    self.toubuHeadView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, JXTableHeaderViewHeight)];
    self.toubuHeadView.backgroundColor = RGB(255, 255, 255);
    //  [self.view addSubview:self.toubuHeadView];
    [self.userHeaderView addSubview:self.toubuHeadView];
    
    
    self.zuixingicoimageview = [[UIImageView alloc]initWithFrame:CGRectMake(15, 20, 96, 96)];
    self.zuixingicoimageview.backgroundColor = RGB(246, 246, 246);
    self.zuixingicoimageview.layer.cornerRadius = 10;
    self.zuixingicoimageview.layer.masksToBounds= YES;
    [self.toubuHeadView addSubview:self.zuixingicoimageview];
    
    self.rankingImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 3, 96, 17)];
    self.rankingImageView.image = [UIImage imageNamed:@"paimingmiaoshu"];
    [self.zuixingicoimageview addSubview:self.rankingImageView];
    
    self.rankingLabel  = [[UILabel alloc]initWithFrame:CGRectMake(0, 0,96,17)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.rankingLabel.textColor = RGB(255 , 255, 255);
    self.rankingLabel.textAlignment = NSTextAlignmentCenter;
    self.rankingLabel.font = [UIFont systemFontOfSize:12];
    self.rankingLabel.text = @"TOP:1";
    [self.rankingImageView  addSubview:self.rankingLabel];
    
    
    
    
    self.mingchengLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.zuixingicoimageview.right+10, 20,300,22)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.mingchengLabel.textColor = RGB(51 , 51, 51);
    self.mingchengLabel.textAlignment = NSTextAlignmentLeft;
    self.mingchengLabel.font = [UIFont systemFontOfSize:16];
    self.mingchengLabel.text = @"怒火一刀（送真冲GM…）";
    [self.toubuHeadView  addSubview:self.mingchengLabel];
    
    
    self.zhekouLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.zuixingicoimageview.right+10+110+100, 20,50,22)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.zhekouLabel.textColor = RGB(255 , 255, 255);
    self.zhekouLabel.textAlignment = NSTextAlignmentCenter;
    self.zhekouLabel.font = [UIFont systemFontOfSize:14];
    self.zhekouLabel.text = @"10折";
    self.zhekouLabel.backgroundColor = [UIColor redColor];
    self.zhekouLabel.layer.cornerRadius = 5;
    self.zhekouLabel.layer.masksToBounds = YES;
    [self.toubuHeadView  addSubview:self.zhekouLabel];
    
    
    
    self.daxiaojingeLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.zuixingicoimageview.right+10, self.mingchengLabel.bottom+8,300,17)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.daxiaojingeLabel.textColor = RGB(153 , 153, 153);
    self.daxiaojingeLabel.textAlignment = NSTextAlignmentLeft;
    self.daxiaojingeLabel.font = [UIFont systemFontOfSize:12];
    self.daxiaojingeLabel.text = @"大小：512M | 策略";
    [self.toubuHeadView  addSubview:self.daxiaojingeLabel];
    
    
    self.tuijianzhishuLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.zuixingicoimageview.right+10, self.daxiaojingeLabel.bottom+6,62,17)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.tuijianzhishuLabel.textColor = RGB(51 , 51, 51);
    self.tuijianzhishuLabel.textAlignment = NSTextAlignmentLeft;
    self.tuijianzhishuLabel.font = [UIFont systemFontOfSize:12];
    self.tuijianzhishuLabel.text = @"推荐指数：";
    //   self.tuijianzhishuLabel.backgroundColor = [UIColor redColor];
    [self.toubuHeadView  addSubview:self.tuijianzhishuLabel];
    
    
    self.storeStarsMuArr = [[NSMutableArray alloc]init];
    
    for (int i = 0 ; i < 5 ; i++) {
        UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.tuijianzhishuLabel.right+1+i*15+i*3, self.daxiaojingeLabel.bottom+6, 15, 15)];
        imageView.image = [UIImage imageNamed:@"xingxingico"];
        imageView.hidden = YES;
        [self.toubuHeadView addSubview:imageView];
        [self.storeStarsMuArr addObject:imageView];
        
        
    }
    
    
    self.oneLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.zuixingicoimageview.right+10, self.tuijianzhishuLabel.bottom+6,60,17)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.oneLabel.textColor = RGB(253 , 165, 88);
    self.oneLabel.textAlignment = NSTextAlignmentCenter;
    self.oneLabel.font = [UIFont systemFontOfSize:12];
    self.oneLabel.text = @"仙侠巨制";
    //  self.oneLabel.backgroundColor = [UIColor redColor];
    self.oneLabel.layer.cornerRadius = 4;
    self.oneLabel.layer.masksToBounds = YES;
    self.oneLabel.layer.borderWidth = 1;
    self.oneLabel.layer.borderColor =RGB(253 , 165, 88).CGColor;
    [self.toubuHeadView addSubview:self.oneLabel];
    
    
    self.twoLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.oneLabel.right+10, self.tuijianzhishuLabel.bottom+6,60,17)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.twoLabel.textColor = RGB(253 , 165, 88);
    self.twoLabel.textAlignment = NSTextAlignmentCenter;
    self.twoLabel.font = [UIFont systemFontOfSize:12];
    self.twoLabel.text = @"巨制";
    //  self.oneLabel.backgroundColor = [UIColor redColor];
    self.twoLabel.layer.cornerRadius = 4;
    self.twoLabel.layer.masksToBounds = YES;
    self.twoLabel.layer.borderWidth = 1;
    self.twoLabel.layer.borderColor =RGB(253 , 165, 88).CGColor;
    [self.toubuHeadView addSubview:self.twoLabel];
    
    self.threeLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.twoLabel.right+10, self.tuijianzhishuLabel.bottom+6,60,17)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.threeLabel.textColor = RGB(253 , 165, 88);
    self.threeLabel.textAlignment = NSTextAlignmentCenter;
    self.threeLabel.font = [UIFont systemFontOfSize:12];
    self.threeLabel.text = @"仙侠";
    //  self.oneLabel.backgroundColor = [UIColor redColor];
    self.threeLabel.layer.cornerRadius = 4;
    self.threeLabel.layer.masksToBounds = YES;
    self.threeLabel.layer.borderWidth = 1;
    self.threeLabel.layer.borderColor =RGB(253 , 165, 88).CGColor;
    [self.toubuHeadView addSubview:self.threeLabel];
    
    
    
    self.pingfenImageView = [[UIImageView alloc]initWithFrame:CGRectMake(kScreenW- 59-15, 40, 59, 59)];
    self.pingfenImageView.image = [UIImage imageNamed:@"duobianxingpingfen"];
    [self.toubuHeadView addSubview: self.pingfenImageView];
    
    
    
    self.zuixingscoreLabel  = [[UILabel alloc]initWithFrame:CGRectMake(0, 0,59,59)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.zuixingscoreLabel.textColor = RGB(51 , 51, 51);
    self.zuixingscoreLabel.textAlignment = NSTextAlignmentCenter;
    self.zuixingscoreLabel.font = [UIFont systemFontOfSize:18];
    self.zuixingscoreLabel.text = @"评分\n8.8";
    //   self.tuijianzhishuLabel.backgroundColor = [UIColor redColor];
    self.zuixingscoreLabel.numberOfLines =0;
    self.zuixingscoreLabel.attributedText  = [WMUtil attributedStringWithText:@"评分\n8.8" withRangText:@"评分" withColor:RGB(51, 51, 51) withFont:[UIFont systemFontOfSize:10]];
    //
    //    self.zuixingscoreLabel.textColor = RGB(51 , 51, 51);
    //    self.zuixingscoreLabel.textAlignment = NSTextAlignmentCenter;
    //    self.zuixingscoreLabel.font = [UIFont systemFontOfSize:20];
    //
    [self.pingfenImageView  addSubview:self.zuixingscoreLabel];
    
    self.kaifubaiseView = [[UIView alloc]initWithFrame:CGRectMake(0, self.zuixingicoimageview.bottom, kScreenW, 15+17+15)];
    self.kaifubaiseView.backgroundColor = [UIColor whiteColor];
    [self.toubuHeadView  addSubview: self.kaifubaiseView];
    
    UIImageView *kaifushijianimage = [[UIImageView alloc]initWithFrame:CGRectMake(15, 15, 16, 16)];
    kaifushijianimage.image = [UIImage imageNamed:@"shangchuangdetupian"];
    [self.kaifubaiseView addSubview:kaifushijianimage];
    
    UIImageView *jiantouimage = [[UIImageView alloc]initWithFrame:CGRectMake(kScreenW-15-7, 15+3, 7, 10)];
    jiantouimage.image = [UIImage imageNamed:@"bianzuico"];
    [self.kaifubaiseView addSubview:jiantouimage];
    
    
    
    self.kaifushijianLabel  = [[UILabel alloc]initWithFrame:CGRectMake(kaifushijianimage.right+10, 15,320,17)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    self.kaifushijianLabel.textColor = RGB(51 , 51, 51);
    self.kaifushijianLabel.textAlignment = NSTextAlignmentLeft;
    self.kaifushijianLabel.font = [UIFont systemFontOfSize:12];
    self.kaifushijianLabel.text = @"开服时间：动态开服";
    [self.kaifubaiseView addSubview:self.kaifushijianLabel];
    
    self.openServiceListButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.openServiceListButton addTarget:self action:@selector(openServiceListButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.kaifubaiseView addSubview:self.openServiceListButton];
    [self.openServiceListButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.mas_equalTo(0);
    }];
    
    self.groupBGView = [[UIImageView alloc] initWithFrame:CGRectMake(15, self.kaifubaiseView.bottom, kScreenW-30, 53)];
    self.groupBGView.image = [UIImage imageNamed:@"gameGroupBGView"];
    self.groupBGView.userInteractionEnabled = YES;
    [self.toubuHeadView addSubview:self.groupBGView];
    
    self.groupNameLabel = [[UILabel alloc] init];
    self.groupNameLabel.font = [UIFont boldSystemFontOfSize:14];
    self.groupNameLabel.textColor = RGB(68 , 68, 68);
    [self.groupBGView addSubview:self.groupNameLabel];
    
    self.groupNewMessageLabel = [[UILabel alloc] init];
    self.groupNewMessageLabel.font = [UIFont systemFontOfSize:10];
    self.groupNewMessageLabel.textColor = RGB(102 , 102, 102);
    [self.groupBGView addSubview:self.groupNewMessageLabel];
    
    self.joinGroupLabel = [[UILabel alloc] init];
    self.joinGroupLabel.font = [UIFont boldSystemFontOfSize:14];
    self.joinGroupLabel.text = @"加入群聊>";
    self.joinGroupLabel.textColor = RGB(68 , 68, 68);
    [self.groupBGView addSubview:self.joinGroupLabel];
    
    self.joinNumLabel = [[UILabel alloc] init];
    self.joinNumLabel.font = [UIFont systemFontOfSize:10];
    self.joinNumLabel.textColor = RGB(102 , 102, 102);
    [self.groupBGView addSubview:self.joinNumLabel];
    
    self.joinGroupButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.joinGroupButton addTarget:self action:@selector(joinGroupButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.groupBGView addSubview:self.joinGroupButton];
    
    
    [self.groupNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(10);
    }];
    
    [self.groupNewMessageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.groupNameLabel);
        make.top.mas_equalTo(self.groupNameLabel.mas_bottom).offset(7);
    }];
    
    [self.joinGroupLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(10);
    }];
    
    [self.joinNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(self.joinGroupLabel.mas_bottom).offset(7);
    }];
    
    [self.joinGroupButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.mas_equalTo(0);
    }];
    
    self.zuixinglibaoView = [[UIView alloc] initWithFrame:CGRectMake(15, self.groupBGView.bottom+10, (kScreenW-30-10)/2 , 58)];
    self.zuixinglibaoView.backgroundColor = RGB(245, 245, 245);
    self.zuixinglibaoView.layer.cornerRadius = 6;
    self.zuixinglibaoView.layer.masksToBounds = YES;
    [self.toubuHeadView addSubview:self.zuixinglibaoView];
    
    UITapGestureRecognizer *libaoShijian= [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(libaoTap)];
    [self.zuixinglibaoView addGestureRecognizer:libaoShijian];
    
    
    
    
    UIImageView *liiamgeView = [[UIImageView alloc]initWithFrame:CGRectMake(14, 16, 25, 25)];
    liiamgeView.image = [UIImage imageNamed:@"zuixinglibaotupian"];
    [self.zuixinglibaoView addSubview:liiamgeView];
    
    
    
    UILabel  *biaotiLabel  = [[UILabel alloc]initWithFrame:CGRectMake(liiamgeView.right+8, 10,160,20)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    biaotiLabel.textColor = RGB(51 , 51, 51);
    biaotiLabel.textAlignment = NSTextAlignmentLeft;
    biaotiLabel.font = [UIFont systemFontOfSize:14];
    biaotiLabel.text = @"礼包";
    biaotiLabel.numberOfLines =2;
    [self.zuixinglibaoView addSubview:biaotiLabel];
    
    
    
    UILabel  *hongdianLabel  = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-30-10)/2-20-5, 5,18,18)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    hongdianLabel.textColor = RGB(255 , 255, 255);
    hongdianLabel.textAlignment = NSTextAlignmentCenter;
    hongdianLabel.font = [UIFont systemFontOfSize:10];
    hongdianLabel.text = @"0";
    hongdianLabel.numberOfLines =2;
    hongdianLabel.backgroundColor = RGB(255, 90, 79);
    hongdianLabel.layer.cornerRadius = 9;
    hongdianLabel.layer.masksToBounds = YES;
    hongdianLabel.tag = 5;
    [self.zuixinglibaoView addSubview:hongdianLabel];
    
    
    UILabel  *zhuanshuLabel  = [[UILabel alloc]initWithFrame:CGRectMake(liiamgeView.right+8, biaotiLabel.bottom+1,160,14)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    zhuanshuLabel.textColor = RGB(153 , 153, 153);
    zhuanshuLabel.textAlignment = NSTextAlignmentLeft;
    zhuanshuLabel.font = [UIFont systemFontOfSize:10];
    zhuanshuLabel.text = @"专属游戏大礼包";
    zhuanshuLabel.numberOfLines = 3;
    [self.zuixinglibaoView addSubview:zhuanshuLabel];
    
    // 优惠券
    self.zuixingyouhuiquView = [[UIView alloc] initWithFrame:CGRectMake(15+(kScreenW-30-10)/2+10, self.groupBGView.bottom+10, (kScreenW-30-10)/2 , 58)];
    self.zuixingyouhuiquView.backgroundColor = RGB(245, 245, 245);
    self.zuixingyouhuiquView.layer.cornerRadius = 6;
    self.zuixingyouhuiquView.layer.masksToBounds = YES;
    [self.toubuHeadView addSubview:self.zuixingyouhuiquView];
    
    
    UITapGestureRecognizer *vouchersjian= [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(vouchersTap)];
    [self.zuixingyouhuiquView addGestureRecognizer:vouchersjian];
    
    UIImageView *liiamgeView1 = [[UIImageView alloc]initWithFrame:CGRectMake(14, 16, 25, 25)];
    liiamgeView1.image = [UIImage imageNamed:@"youhuiquico"];
    [self.zuixingyouhuiquView addSubview:liiamgeView1];
    
    UILabel  *biaotiLabel1  = [[UILabel alloc]initWithFrame:CGRectMake(liiamgeView1.right+8, 10,160,20)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    biaotiLabel1.textColor = RGB(51 , 51, 51);
    biaotiLabel1.textAlignment = NSTextAlignmentLeft;
    biaotiLabel1.font = [UIFont systemFontOfSize:14];
    biaotiLabel1.text = @"优惠券";
    biaotiLabel1.numberOfLines =2;
    [self.zuixingyouhuiquView addSubview:biaotiLabel1];
    
    
    UILabel  *zhuanshuLabel1  = [[UILabel alloc]initWithFrame:CGRectMake(liiamgeView.right+8, biaotiLabel.bottom+1,160,14)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    zhuanshuLabel1.textColor = RGB(153 , 153, 153);
    zhuanshuLabel1.textAlignment = NSTextAlignmentLeft;
    zhuanshuLabel1.font = [UIFont systemFontOfSize:10];
    zhuanshuLabel1.text = @"领取";
    zhuanshuLabel1.numberOfLines = 3;
    zhuanshuLabel1.tag= 10 ;
    [self.zuixingyouhuiquView addSubview:zhuanshuLabel1];
    
    
    UILabel  *hongdianLabel1  = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-30-10)/2-20-5, 5,18,18)];
    //  self.huishouxuzhiLabel.backgroundColor = RGB(255, 217, 161);
    //    self.huishouxuzhiLabel.layer.cornerRadius = 32;
    //    self.huishouxuzhiLabel.layer.masksToBounds = YES;
    hongdianLabel1.textColor = RGB(255 , 255, 255);
    hongdianLabel1.textAlignment = NSTextAlignmentCenter;
    hongdianLabel1.font = [UIFont systemFontOfSize:10];
    hongdianLabel1.text = @"0";
    hongdianLabel1.numberOfLines =2;
    hongdianLabel1.backgroundColor = RGB(255, 90, 79);
    hongdianLabel1.layer.cornerRadius = 9;
    hongdianLabel1.layer.masksToBounds = YES;
    hongdianLabel1.tag = 5;
    [self.zuixingyouhuiquView addSubview:hongdianLabel1];
    
    
    self.huiseview = [[UIView alloc] initWithFrame:CGRectMake(0, self.zuixingyouhuiquView.bottom+15, kScreenW, 10)];
    self.huiseview.backgroundColor = RGB(246, 246, 246);
    [self.userHeaderView addSubview:self.huiseview];
    
    
}
- (void)openServiceListButtonClick:(UIButton *)button {
    [self.categoryView selectItemAtIndex:2];
}
- (void)joinGroupButtonClick:(UIButton *)button {
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController  *login = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
        return;
        
    }
    XMGWebViewController *webVC = [[XMGWebViewController alloc] init];
    webVC.url = [NSURL URLWithString:self.groupUrl];
    webVC.isGroup = YES;
    [self.navigationController pushViewController:webVC animated:YES];
}

// 点击礼包
- (void)libaoTap {
    
    
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController  *login = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
        return;
        
    }
    
    NSString *url = [NSString stringWithFormat:@"%@?ct=app2021&ios=1&ac=lb_list&uid=%@&gid=%@&member_id=%@",[HWOCGlobalConst baseUrl],[HWLocallyStoredData getLoginUserID],self.gameId,member_id];
    
    HWWebViewGameViewController *webview = [[HWWebViewGameViewController alloc]init];
    webview.urlString = url;
    webview.gname = @"领取礼包";
    webview.panduanStr = @"1";
    webview.gameId = self.gameId;
    
    webview.hidesBottomBarWhenPushed = NO;
    [self.navigationController pushViewController:webview animated:YES];
    
    
    
}
//点击优惠券
- (void)vouchersTap {
    
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController  *login = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
        return;
        
    }
    
    NSString *uid = [HWLocallyStoredData getLoginUserID];
    NSString *tString = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    //  NSString *gidStr = [NSString stringWithFormat:@"%@",self.gameId];
    NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uid,tString,@"fsd213ewdsadqwe2121213edsad"];
    NSString *signMD5 = [WMUtil md5HexDigest:signStr];
    
    NSString *url = [NSString stringWithFormat:@"%@?ct=app2021&ac=coupon1&uid=%@&t=%@&sign=%@&gid=%@&member_id=%@",[HWOCGlobalConst baseUrl],[HWLocallyStoredData getLoginUserID],tString,signMD5,self.gameId,member_id];
    
    HWWebViewGameViewController *webview = [[HWWebViewGameViewController alloc]init];
    webview.urlString = url;
    webview.gname = @"领取优惠券";
    webview.panduanStr = @"2";
    webview.gameId = self.gameId;
    webview.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:webview animated:YES];
    
    
    
    
}





- (void)initUI{
    //    self.title = @"收支明细";
    // self.view.backgroundColor = [UIColor whiteColor];
    
    self.categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, NavBarHeight+235+10, kScreenW, 40)];
    self.categoryView.titles = @[@"详情",@"评价",@"开服",@"交易"];
    self.categoryView.averageCellSpacingEnabled = YES;
    self.categoryView.titleFont = [UIFont systemFontOfSize:14];
    self.categoryView.titleSelectedFont = [UIFont systemFontOfSize:18];
    self.categoryView.backgroundColor = [UIColor clearColor];
    self.categoryView.backgroundColor = [UIColor whiteColor];
    self.categoryView.delegate = self;
    self.categoryView.titleSelectedColor =  RGB(247, 124, 47);
    self.categoryView.titleColor = RGB(51, 51, 51);
    self.categoryView.titleColorGradientEnabled = YES;
    self.categoryView.titleLabelZoomEnabled = YES;
    self.categoryView.contentScrollViewClickTransitionAnimationEnabled = NO;
    
    JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] initWithFrame:CGRectMake(0, NavBarHeight+235-100, kScreenW, 2)];
    lineView.indicatorColor =  RGB(247, 124, 47);
    lineView.indicatorHeight = 2;
    lineView.indicatorWidth = 30;
    self.categoryView.indicators = @[lineView];
    self.categoryView.listContainer = self.listContainerView;
    [self.view addSubview:self.categoryView];
}


- (void)addLowerPartView {
    
    self.lowerPartView = [[UIView alloc]initWithFrame:CGRectMake(0, kScreenH-60-CF_TabbarSafeBottomMargin, kScreenW, 60+CF_TabbarSafeBottomMargin)];
    // self.lowerPartView.backgroundColor = [UIColor yellowColor];
    self.lowerPartView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.lowerPartView];
    
    UIButton *butt  = [UIButton setButtonWithFrame:CGRectMake(120, 12, kScreenW-120-15, 36) Title:@"下载游戏" Image:nil Font:13 Color:RGB(255, 255, 155) Target:self Selector:@selector(buttonTap:)];
    self.downloadBut = butt;
    butt.backgroundColor = RGB(38, 154, 255);
    butt.layer.cornerRadius = 4;
    butt.layer.masksToBounds = YES;
    [self.lowerPartView addSubview:butt];
    
    
    self.downloadBut.backgroundColor = [UIColor bm_colorGradientChangeWithSizeView: self.downloadBut];
    
    UIButton *butt1  = [UIButton setButtonWithFrame:CGRectMake(50+20, 10, 30, 20+17+4) Title:@"收藏" Image:@"meiyouxuangzhong" Font:12 Color:RGB(178, 178, 178) Target:self Selector:@selector(shoucangTap:)];
    [butt1 setImage:[UIImage imageNamed:@"shoucangico"] forState:UIControlStateSelected];
    self.shouCangBut = butt1;
    // butt1.backgroundColor = RGB(38, 154, 255);
    [butt1 layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:4];
    [self.lowerPartView addSubview:butt1];
    
    UIButton *butt2  = [UIButton setButtonWithFrame:CGRectMake(20, 10, 30, 20+17+4) Title:@"评价" Image:@"pingjiadexiezuo" Font:12 Color:RGB(178, 178, 178) Target:self Selector:@selector(pingjianBut:)];
    // butt1.backgroundColor = RGB(38, 154, 255);
    [butt2 layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:4];
    [self.lowerPartView addSubview:butt2];
    
    
    
    
    
}

//评价
- (void)pingjianBut:(UIButton *)sender {
    
    HWpingjiajiemianViewController *pijiajimein = [[HWpingjiajiemianViewController alloc]init];
    pijiajimein.gameIDStr = self.gameId;
    [self.navigationController pushViewController:pijiajimein animated:YES];
    
    
}




- (void)initFrame{
    
    self.listContainerView.frame = CGRectMake(0, self.categoryView.bottom, kScreenW, kScreenH-NavBarHeight-235-40-TabbarSafeBottomMargin-60);
    
    
}






- (JXCategoryListContainerView *)listContainerView {
    if (_listContainerView == nil) {
        _listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
    }
    [self.view addSubview:_listContainerView];
    return _listContainerView;
}

#pragma mark - JXCategoryListContainerViewDelegate

//- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
//
//    if (index == 0) {
//        HWxiangqingkunzhiqiViewController *pageController = [[HWxiangqingkunzhiqiViewController alloc] init];
//        pageController.gameId = self.gameId;
//        return  pageController;
//        
//        
//        
//    } else if (index == 1) {
//        
//        HWEvaluationPingJiaViewController *pageController = [[HWEvaluationPingJiaViewController alloc] init];
//        pageController.gameId = self.gameId;
//        
//        return  pageController;
//        
//        
//    } else if (index == 2) {
//        
//        HWNewOpenClothingViewController *OpenClothing = [[HWNewOpenClothingViewController alloc]init];
//        OpenClothing.gameId = self.gameId;
//        return  OpenClothing;
//        
//        
//    }else if (index == 3) {
//        
//        HWzuixingjiaoyiViewController *pageController = [[HWzuixingjiaoyiViewController alloc] init];
//        pageController.gameId =  self.gameId;
//        
//        return  pageController;
//        
//        
//        
//    }else{
////        KXIncomeDetailPageController *pageController = [[KXIncomeDetailPageController alloc] init];
////        pageController.type = @"2";
//    //    return  pageController;
//        
//        HWEvaluationPingJiaViewController *pageController = [[HWEvaluationPingJiaViewController alloc] init];
//        return  pageController;
//        
//        
//        
//    }
//    
//}
//
//- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
//    return 4;
//}
//
//






//- (void)viewDidLoad {
//    [super viewDidLoad];
//    self.automaticallyAdjustsScrollViewInsets = YES;
//
//    // 设置常用的属性
//    [self setupAttribute];
//
//    // Do any additional setup after loading the view.
//    [self setUpUI];
//
//    [self listeningNSNotificationCenter];
//
//    //详情顶部
//    [self topGameDetails];
//
//    // 详情
//    [self xiangqingmiaoshu];
//
//
//
//
//
//}
//
//
//// 详情顶部
- (void)topGameDetails {
    
    
    NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
    
    NSString *path2 = [NSString stringWithFormat:@"%@/%@", bundlePath, @"coid"];
    
    NSFileManager *manager = [NSFileManager defaultManager];
    
    //        NSString *channel = @"";
    
    
    NSString *channel = [NSString string];
    if ([manager fileExistsAtPath:path2]) {
        NSArray *allPath =[manager subpathsAtPath:path2];
        //4.遍历所有的子路径
        for (NSString *subPath in allPath) {
            if ([subPath containsString:@"coid_"]) {
                channel = [subPath substringFromIndex:@"coid_".length];
                NSLog(@"文件夹名字%@+++",  channel);
            }
        }
    }
    if ([channel isEqual:@""]) {
        member_id = [NSString stringWithFormat:@"0"];
    } else {
        member_id = [NSString stringWithFormat:@"%@",channel];
    }
    NSLog(@"有值吗++%@+++", member_id);
    
    
    
    
    
    
    NSDictionary *parametes  = nil;
    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        
        parametes = @{
            @"id" : self.gameId,
            @"ios" : @"1",
            @"ct" :  @"app2021",
            @"ac" : @"gameinfo_top",
            @"member_id":member_id,
        };
        
        
    } else {
        parametes = @{
            @"id" : self.gameId,
            @"ios" : @"1",
            @"uid" : [HWLocallyStoredData getLoginUserID],
            @"ct" : @"app2021",
            @"ac" : @"gameinfo_top",
            @"member_id":member_id,
        };
        
    }
    
    
    
    [MBProgressHUD showMessage:@"正在加载" toView:nil mobanshezhi:YES];
    
    
    
    
    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
        
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        
        [MBProgressHUD hideHUD];
        
        
        if ([codeStr intValue] == 1) {
            
            HWDetailsTopModel *mdel = [HWDetailsTopModel mj_objectWithKeyValues:response];
            self.topModel = mdel;
            
            if ([self.topModel.shoucang isEqualToString:@"0"]) {
                self.shouCangBut.selected = NO;
                
            } else {
                self.shouCangBut.selected = YES;
            }
            
            
            if ([self.topModel.zhekou isEqualToString:@""]) {
                
                self.zhekouLabel.hidden = YES;
                
                
            } else if (self.topModel.zhekou == nil) {
                
                self.zhekouLabel.hidden = YES;
                
            }else {
                
                self.zhekouLabel.hidden = NO;
                
                
                CGSize size1 =  [WMUtil sizeWithFont1:[UIFont systemFontOfSize:16] maxSize:CGSizeMake(1000, 200) string:self.topModel.name];
                
                self.zhekouLabel.frame  =CGRectMake(self.zuixingicoimageview.right+10+size1.width+10, 20, 45, 22);
                
                self.zhekouLabel.text = [NSString stringWithFormat:@"%@折",self.topModel.zhekou];
                if ([self.topModel.zhekou hasPrefix:@"10"]) {
                    self.zhekouLabel.hidden = YES;
                }
                
                
            }
            
            
            self.rankingLabel.text = [NSString stringWithFormat:@"TOP:%@",mdel.paihang];
            
            
            
            NSURL *icoUrl = [NSURL URLWithString:self.topModel.icon];
            [self.zuixingicoimageview sd_setImageWithURL:icoUrl];
            self.mingchengLabel.text = self.topModel.name;
            
            self.daxiaojingeLabel.text = [NSString stringWithFormat:@"大小：%@M | %@",self.topModel.size,self.topModel.type];
            
            NSString *pingfen = [NSString stringWithFormat:@"评分\n%@",self.topModel.point];
            self.zuixingscoreLabel.attributedText  = [WMUtil attributedStringWithText:pingfen withRangText:@"评分" withColor:RGB(51, 51, 51) withFont:[UIFont systemFontOfSize:10]];
            //   point  这个是推荐指数
            int xingge =  [self.topModel.tuijianzhishu intValue];
            for (int i = 0; i < 5 ; i++) {
                UIImageView *imageview =  self.storeStarsMuArr[i];
                if (i < xingge) {
                    
                    imageview.hidden = NO;
                    
                } else {
                    
                    imageview.hidden = YES;
                }
                
            }
            self.oneLabel.hidden = YES;
            self.twoLabel.hidden= YES;
            self.threeLabel.hidden = YES;
            for (int i =0 ; i < self.topModel.biaoqian.count ; i++) {
                
                if (i == 0 ) {
                    CGSize size1 =  [WMUtil sizeWithFont1:[UIFont systemFontOfSize:12] maxSize:CGSizeMake(1000, 200) string:self.topModel.biaoqian[i]];
                    
                    self.oneLabel.text = [NSString stringWithFormat:@"%@",self.topModel.biaoqian[i]];
                    self.oneLabel.frame = CGRectMake(self.zuixingicoimageview.right+10, self.tuijianzhishuLabel.bottom+6, size1.width+10, 17);
                    self.oneLabel.hidden = NO;
                    
                }else if (i == 1) {
                    
                    CGSize size1 =  [WMUtil sizeWithFont1:[UIFont systemFontOfSize:12] maxSize:CGSizeMake(1000, 200) string:self.topModel.biaoqian[i]];
                    
                    self.twoLabel.text = [NSString stringWithFormat:@"%@",self.topModel.biaoqian[i]];
                    self.twoLabel.frame = CGRectMake(self.oneLabel.right+10, self.tuijianzhishuLabel.bottom+6, size1.width+10, 17);
                    self.twoLabel.hidden = NO;
                } else {
                    CGSize size1 =  [WMUtil sizeWithFont1:[UIFont systemFontOfSize:12] maxSize:CGSizeMake(1000, 200) string:self.topModel.biaoqian[i]];
                    self.threeLabel.text = [NSString stringWithFormat:@"%@",self.topModel.biaoqian[i]];
                    
                    
                    self.threeLabel.frame =  CGRectMake(self.twoLabel.right+10, self.tuijianzhishuLabel.bottom+6, size1.width+10, 17);
                    self.threeLabel.hidden = NO;
                }
                
                
            }
            
            NSString  *codeStr =   [NSString stringWithFormat:@"%@",self.topModel.servers[@"code"]];
            
            if ([codeStr intValue] == 1 ) {
                
                NSDictionary *dic = self.topModel.servers[@"data"][0];
                //  self.kaifushijianLabel.text = @"开服时间：动态开服";
                self.kaifushijianLabel.text =  [NSString stringWithFormat:@"开服动态：%@  %@",dic[@"create_time"],dic[@"server_name"]];
                
                
            } else {
                
                self.kaifushijianLabel.text =  [NSString stringWithFormat:@"开服动态：%@",@"暂无开服"];
                
                
            }
            
            
            UILabel *biaoqi =    (UILabel * )[self.zuixingyouhuiquView viewWithTag:10];
            
            
            if (self.topModel.small_coupon == nil) {
                
                biaoqi.text= [NSString stringWithFormat:@"%@ ",@"领取优惠券"];
                
            } else {
                biaoqi.text= [NSString stringWithFormat:@"%@ ~ %@",self.topModel.small_coupon,self.topModel.max_coupon];
                
            }
            //   biaoqi.text= [NSString stringWithFormat:@"%@ ~ %@",self.topModel.small_coupon,self.topModel.max_coupon];
            
            UILabel *bibao = (UILabel *)[self.zuixinglibaoView viewWithTag:5];
            if ([self.topModel.lb_num isEqualToString:@"0"]) {
                bibao.hidden = YES;
            } else {
                bibao.hidden = NO;
                bibao.text = self.topModel.lb_num;
                
            }
            
            UILabel *youhuiqu = (UILabel *)[self.zuixingyouhuiquView viewWithTag:5];
            if ([self.topModel.coupon_num  isEqualToString:@"0"]) {
                
                youhuiqu.hidden = YES;
            } else {
                youhuiqu.hidden = NO;
                youhuiqu.text = self.topModel.coupon_num;
                
            }
            
            
            
            
            
            // zhekou
            //   self.penfenlabel.text = [NSString stringWithFormat:@"%@",mdel.point];
            
            //  游戏系统 1安卓 2IOS 3双端   system 字段的意思
            if ([self.topModel.system isEqualToString:@"1"] ) {
                
                [self.downloadBut setTitle:@"立即下载" forState:UIControlStateNormal];
                
            } else {
                
                //   1 手机游戏 2 H5游戏
                
                if ([self.topModel.system_type isEqualToString:@"1"]) {
                    //   1 手机游戏
                    [self.downloadBut setTitle:@"立即下载" forState:UIControlStateNormal];
                    
                } else  if ([self.topModel.system_type isEqualToString:@"2"]){
                    
                    // 2 H5游戏
                    [self.downloadBut setTitle:@"打开" forState:UIControlStateNormal];
                    self.contentLabel.text = [NSString stringWithFormat:@"%@",self.topModel.summary];
                    // self.contentLabel.hidden = YES;
                    self.wangguoleLabel.text = @"玩过了";
                    self.wangguoleLabel.text = @"推荐指数";
                    
                } else {
                    
                    [self.downloadBut setTitle:@"立即下载" forState:UIControlStateNormal];
                    
                    
                }
                
                
                
            }
            
            
            
        } else {
            
            
            [MBProgressHUD showError:response[@"message"]];
            
        }
        
        
        
    } failure:^(NSString *error) {
        
        [MBProgressHUD hideHUD];
        
        //   [self.navigationController popViewControllerAnimated:YES];
        
        
        //   [MBProgressHUD ];
        
    }];
    
    NSString *userID = [HWLocallyStoredData getLoginUserID];
    
    int t =    [WMUtil getRandomNumber:101 to:998];
    NSString *tStr = [NSString stringWithFormat:@"%ld%d",[WMUtil getTimeSp],t];
    NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
    NSString *signMD5 = [WMUtil md5HexDigest:sign];
    
    NSDictionary *para = @{
        @"id" : self.gameId,
        @"ios" : @"1",
        @"ct" :  @"app2022",
        @"ac" : @"game_qun",
        @"member_id":member_id,
        @"uid":userID,
        @"t":tStr,
        @"sign":signMD5
    };
    
    [HWWebUtils do3GetWithParameters:para progress:nil success:^(id response) {
        
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        
        [MBProgressHUD hideHUD];
        
        
        if ([codeStr intValue] == 1) {
            
            self.groupBGView.hidden = NO;
            self.groupNameLabel.text = response[@"data"][@"name"];
            self.groupNewMessageLabel.text = response[@"data"][@"new_xiaoxi"];
            
            if ([response[@"data"][@"is_join"] integerValue] == 1) {
                
                self.joinGroupLabel.text = @"查看消息>";
            }else {
                self.joinGroupLabel.text = @"加入群聊>";
            }
            
            NSString *numString = [response[@"data"][@"num"] stringValue];
            NSString *string = [NSString stringWithFormat:@"已有%@人加入",numString];
            NSMutableAttributedString *aString = [[NSMutableAttributedString alloc] initWithString:string];
            NSRange range = [string rangeOfString:numString];
            [aString addAttribute:NSForegroundColorAttributeName value:RGB(252, 148, 79) range:range];
            self.joinNumLabel.attributedText = aString;
            
            self.groupUrl = response[@"data"][@"url"];
            self->JXTableHeaderViewHeight = 245 + 70;
            self.userHeaderView.height = self->JXTableHeaderViewHeight;
        } else {
            
            self.groupBGView.hidden = YES;
            
            self.zuixinglibaoView.top = self.kaifubaiseView.bottom;
            self.zuixingyouhuiquView.top = self.kaifubaiseView.bottom;
            self.huiseview.top = self.zuixingyouhuiquView.bottom + 15;
            
            self->JXTableHeaderViewHeight = 245;
            self.userHeaderView.height = 245;
            [self.pagingView reloadData];
            
        }
        
        
        
    } failure:^(NSString *error) {
        
        [MBProgressHUD hideHUD];
        
        //   [self.navigationController popViewControllerAnimated:YES];
        
        
        //   [MBProgressHUD ];
        
    }];
    
}









//// 详情的接口
//- (void)xiangqingmiaoshu {
//
//
//    NSDictionary *parametes  = nil;
//    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//
//        parametes = @{
//                                                  @"id" : self.gameId,
//                                                  @"ios" : @"1",
//                                                  @"ct" :  @"app",
//                                                  @"ac" : @"game_info1"
//                                                  };
//
//
//    } else {
//
//
//              parametes = @{
//                                            @"id" : self.gameId,
//                                            @"ios" : @"1",
//                                            @"uid" : [HWLocallyStoredData getLoginUserID],
//                                            @"ct" : @"app",
//                                            @"ac" : @"game_info1"
//                                            };
//
//
//    }
//
//
//
//
//
//
//    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
//
//
//
//          NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//
//          if ([codeStr intValue] == 1) {
//              NSLog(@"%@",response);
//              self.xiangqngDic = response[@"data"];
//              [self.mainaTableVie reloadData];
//
//
//
//
//          } else {
//
//
//              [MBProgressHUD showError:response[@"message"]];
//
//          }
//
//
//
//      } failure:^(NSString *error) {
//
//
//      }];
//
//
//
//}
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//#pragma  mark ------- 监听通知
//- (void)listeningNSNotificationCenter {
//
//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshTableView:) name:@"xianqingtongzhSentimentOnTheSlide" object:nil];
//
//
//
//}
//
//- (void)refreshTableView:(NSNotification *)noti {
//
//    NSLog(@"%@",noti.userInfo);
//    NSDictionary *dic = noti.userInfo;
//    NSString *str  = [NSString stringWithFormat:@"%@",dic[@"rolling"]];
//    int  a = [str intValue];
//    // judgeStr
//    if (a == 1) {
//
//        self.zhangkai = YES;
//
//        [self.mainaTableVie reloadData];
//
//
//
//    } else {
//
//        self.zhangkai = NO;
//         [self.mainaTableVie reloadData];
//    }
//
//
//}
//
////  设置常用的属性
//- (void)setupAttribute {
//    self.zhangkai = NO;
//    self.xuanzhongTag = 0;
//    self.kaifuData = @[@"1ii1i",@"ihdsbuh"];
//   // self.kaifuData = [[NSArray alloc]init];
//
//}
//
//
//
//// 设置UI
//- (void)setUpUI {
//
//    self.view.backgroundColor = [UIColor whiteColor];
//
//
//    [self.view addSubview:self.mainaTableVie];
//    UIView *hederview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, StatusBarHeight+17*3+196+5)];
//    hederview.backgroundColor  = [UIColor redColor];
//    hederview.backgroundColor = RGB(248, 248, 248);
//    self.hederView = hederview;
//    self.mainaTableVie.tableHeaderView = hederview;
//
//    // 返回按钮
//    [self navigaView];
//
//    //设置背景图
//    [self shezhibeijingView];
//
//    //  添加卡片Uiview
//    [self addCardView];
//
//    //添加底部Uiview
//    [self addLowerPartView];
//
//}
//
//
//
//
//// 添加低部UIview
//- (void)addLowerPartView {
//
//    self.lowerPartView = [[UIView alloc]initWithFrame:CGRectMake(0, kScreenH-44-CF_TabbarSafeBottomMargin, kScreenW, 44+CF_TabbarSafeBottomMargin)];
//    // self.lowerPartView.backgroundColor = [UIColor yellowColor];
//    self.lowerPartView.backgroundColor = [UIColor whiteColor];
//    [self.view addSubview:self.lowerPartView];
//
//    UIButton *butt  = [UIButton setButtonWithFrame:CGRectMake(65, 7, kScreenW-65*2, 30) Title:@"立即下载" Image:nil Font:13 Color:RGB(255, 255, 155) Target:self Selector:@selector(buttonTap:)];
//    self.downloadBut = butt;
//    butt.backgroundColor = RGB(38, 154, 255);
//    butt.layer.cornerRadius = 15;
//     butt.layer.masksToBounds = YES;
//     [self.lowerPartView addSubview:butt];
//
//
//    self.downloadBut.backgroundColor = [UIColor bm_colorGradientChangeWithSizeView: self.downloadBut];
//
//    UIButton *butt1  = [UIButton setButtonWithFrame:CGRectMake(7, 0, 50, 44) Title:@"收藏" Image:@"details_sellect_a" Font:10 Color:RGB(178, 178, 178) Target:self Selector:@selector(shoucangTap:)];
//    [butt1 setImage:[UIImage imageNamed:@"details_sellect_b"] forState:UIControlStateSelected];
//    self.shouCangBut = butt1;
//    // butt1.backgroundColor = RGB(38, 154, 255);
//    [butt1 layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:5];
//    [self.lowerPartView addSubview:butt1];
//
//    UIButton *butt2  = [UIButton setButtonWithFrame:CGRectMake(kScreenW-65+7, 0, 50, 44) Title:@"分享" Image:@"details_share_a" Font:10 Color:RGB(178, 178, 178) Target:self Selector:@selector(fenxiangTap:)];
//    // butt1.backgroundColor = RGB(38, 154, 255);
//    [butt2 layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:5];
//    [self.lowerPartView addSubview:butt2];
//
//
//}
//
//
//
//
//
#pragma mark -----  点击立即下载按钮
- (void)buttonTap:(UIButton *)sender {
    
    
    
    
    
    NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
    
    NSString *path2 = [NSString stringWithFormat:@"%@/%@", bundlePath, @"coid"];
    
    NSFileManager *manager = [NSFileManager defaultManager];
    
    //        NSString *channel = @"";
    
    
    NSString *channel = [NSString string];
    if ([manager fileExistsAtPath:path2]) {
        NSArray *allPath =[manager subpathsAtPath:path2];
        //4.遍历所有的子路径
        for (NSString *subPath in allPath) {
            if ([subPath containsString:@"coid_"]) {
                channel = [subPath substringFromIndex:@"coid_".length];
                NSLog(@"文件夹名字%@+++",  channel);
            }
        }
    }
    if ([channel isEqual:@""]) {
        member_id = [NSString stringWithFormat:@"0"];
    } else {
        member_id = [NSString stringWithFormat:@"%@",channel];
    }
    NSLog(@"有值吗++%@+++", member_id);
    
    
    
    
    
    
    
    
    //    if([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
    //
    //
    //         HWLoginController *log = [[HWLoginController alloc]init];
    //         [self.navigationController pushViewController:log animated:YES];
    //
    //     } else {
    //
    //         NSLog(@"111立即下载");
    //
    //         //  游戏系统 1安卓 2IOS 3双端   system 字段的意思
    //         if ([self.topModel.system isEqualToString:@"1"] ) {
    //
    //
    //             [MBProgressHUD showError:@"此游戏没有IOS版本"];
    //
    //
    //
    //
    //          } else {
    //
    //              //   1 手机游戏 2 H5游戏
    //
    //            if ([self.topModel.system_type isEqualToString:@"1"]) {
    //                //   1 手机游戏
    //
    //
    //                if(self.topModel.ios.length > 0) {
    //
    //                     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.topModel.ios]];
    //
    //                } else {
    //
    //                    [MBProgressHUD showError:@"此游戏暂未上架"];
    //                }
    //                // [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.topModel.ios]];
    //
    //
    //
    //
    //
    //            } else  if ([self.topModel.system_type isEqualToString:@"2"]){
    //
    //                    // 2 H5游戏
    //                //  NSString *url = [NSString stringWithFormat:@"https://www.baidu.com"];
    //
    //                NSString *userID = [HWLocallyStoredData getLoginUserID];
    //
    //                int t =    [WMUtil getRandomNumber:101 to:998];
    //                 NSString *tStr = [NSString stringWithFormat:@"%ld%d",[WMUtil getTimeSp],t];
    //                 NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
    //                 NSString *signMD5 = [WMUtil md5HexDigest:sign];
    //
    //
    //                  NSString *url = [NSString stringWithFormat:@"%@?ct=h5login&gid=%@&uid=%@&type=1&t=%@&sign=%@", [HWGlobalConst baseUrl], self.gameId,[HWLocallyStoredData getLoginUserID],tStr,signMD5];
    //
    //                  HWWebViewGameViewController *webview = [[HWWebViewGameViewController alloc]init];
    //                  webview.urlString = url;
    //                  webview.gname = self.topModel.name;
    //                  webview.hidesBottomBarWhenPushed = YES;
    //                  [self.navigationController pushViewController:webview animated:YES];
    //
    //
    //
    //            } else {
    //
    //                  [MBProgressHUD showError:@"此游戏暂未上架"];
    //
    //
    //            }
    //
    //
    //
    //        }
    //
    //
    //
    //
    //
    //
    //     }
    
    
    
    
    if([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        
        
        HWLoginController *log = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:log animated:YES];
        return;
        
        
        
    }
    
    
    
    NSLog(@"111立即下载");
    
    //  游戏系统 1安卓 2IOS 3双端   system 字段的意思
    if ([self.topModel.system isEqualToString:@"1"] ) {
        
        
        [MBProgressHUD showError:@"此游戏没有IOS版本"];
        
        
        
    } else {
        
        //   1 手机游戏 2 H5游戏
        
        if ([self.topModel.system_type isEqualToString:@"1"]) {
            //   1 手机游戏
            
            if ([member_id isEqualToString:@"0"]) {
            } else {
                if([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
                    HWLoginController *log = [[HWLoginController alloc]init];
                    [self.navigationController pushViewController:log animated:YES];
                    return;
                }
            }
            if(self.topModel.ios.length > 0) {
                if ([self.topModel.shoucang isEqualToString:@"0"]) {
                    // 收藏
                    [self shoucangcollection];
                }
                
            } else {
                if ([[HWOCGlobalConst baseUrl] containsString:@"http://pro.94wan.com"]) {
                    [MBProgressHUD showError:@"该游戏禁止下载，请联系400-869-9305"];
                    return;
                }
                [MBProgressHUD showError:@"此游戏暂未上架"];
            }
            // [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.topModel.ios]];

        } else  if ([self.topModel.system_type isEqualToString:@"2"]){
            
            // 2 H5游戏
            //  NSString *url = [NSString stringWithFormat:@"https://www.baidu.com"];
            if([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
                HWLoginController *log = [[HWLoginController alloc]init];
                [self.navigationController pushViewController:log animated:YES];
                return;
            }
            NSString *userID = [HWLocallyStoredData getLoginUserID];
            int t =    [WMUtil getRandomNumber:101 to:998];
            NSString *tStr = [NSString stringWithFormat:@"%ld%d",[WMUtil getTimeSp],t];
            NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
            NSString *signMD5 = [WMUtil md5HexDigest:sign];
            NSString *url = [NSString stringWithFormat:@"%@?ct=h5login&gid=%@&uid=%@&type=1&t=%@&sign=%@", [HWOCGlobalConst baseUrl], self.gameId,[HWLocallyStoredData getLoginUserID],tStr,signMD5];
            HWWebViewGameViewController *webview = [[HWWebViewGameViewController alloc]init];
            webview.urlString = url;
            webview.gname = self.topModel.name;
            webview.hidesBottomBarWhenPushed = YES;
            [self.navigationController pushViewController:webview animated:YES];
            
            if ([self.topModel.shoucang isEqualToString:@"0"]) {
                
                // 收藏
                [self shoucangcollection];
                
                
            }
            
            
            
        } else {
            
            [MBProgressHUD showError:@"此游戏暂未上架"];
            
            
        }
        
        
        
    }
    
    
    
    
}

// 点击收藏按钮
- (void)shoucangTap:(UIButton *)sender {
    
    
    if([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
        HWLoginController *log = [[HWLoginController alloc]init];
        [self.navigationController pushViewController:log animated:YES];
        
    } else {
        
        
        
        NSLog(@"1111   %@",self.topModel.shoucang);
        
        if ([self.topModel.shoucang isEqualToString:@"0"]) {
            
            // 收藏
            [self shoucangcollection];
            
            
        }  else  {
            
            // 取消收藏
            [self quexiaoCollection];
            
            
            
        }
        
        
        
    }
    
    
    //    if (sender.selected) {
    //        sender.selected = NO;
    //
    //    } else {
    //         sender.selected = YES;
    //
    //    }
    DLog(@"lmjopojp");
    
}










// 分享
- (void)fenxiangTap:(UIButton *)sender {
    
    
    //    [MBProgressHUD showError:@"此功能暂未开通"];
    //    return;
    //
    
    
    //    HWFenXiangGameView *FenXiang = [[HWFenXiangGameView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
    //     FenXiang.delegate = self;
    //     [kKeyWindow addSubview:FenXiang];
    //
    //     return ;
    
    
    
    
    
    
    if(self.topModel.ios.length > 0) {
        
        HWerweiMaFenXiangView  *fenxiang = [[HWerweiMaFenXiangView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
        fenxiang.urlStr = self.topModel.ios;
        [kKeyWindow addSubview:fenxiang];
        
        
        
        
        
    } else {
        
        
        
        if ([self.topModel.system_type isEqualToString:@"2"] ) {
            
            
            
            NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
            
            NSString *path2 = [NSString stringWithFormat:@"%@/%@", bundlePath, @"coid"];
            
            NSFileManager *manager = [NSFileManager defaultManager];
            
            //        NSString *channel = @"";
            
            
            NSString *channel = [NSString string];
            if ([manager fileExistsAtPath:path2]) {
                NSArray *allPath =[manager subpathsAtPath:path2];
                //4.遍历所有的子路径
                for (NSString *subPath in allPath) {
                    if ([subPath containsString:@"coid_"]) {
                        channel = [subPath substringFromIndex:@"coid_".length];
                        NSLog(@"文件夹名字%@+++",  channel);
                    }
                }
            }
            if ([channel isEqual:@""]) {
                member_id = [NSString stringWithFormat:@"0"];
            } else {
                member_id = [NSString stringWithFormat:@"%@",channel];
            }
            
            
            NSString *userID = [HWLocallyStoredData getLoginUserID];
            
            int t =    [WMUtil getRandomNumber:101 to:998];
            NSString *tStr = [NSString stringWithFormat:@"%ld%d",[WMUtil getTimeSp],t];
            NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
            NSString *signMD5 = [WMUtil md5HexDigest:sign];
            
            NSString *url = [NSString stringWithFormat:@"%@?ct=h5login&gid=%@&member_id=%@", [HWOCGlobalConst baseUrl], self.gameId,member_id];
            
            HWerweiMaFenXiangView  *fenxiang = [[HWerweiMaFenXiangView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
            fenxiang.urlStr =url;
            [kKeyWindow addSubview:fenxiang];
            
            
        } else {
            
            [MBProgressHUD showError:@"此游戏暂未上架"];
        }
        
        
        // [MBProgressHUD showError:@"此游戏暂未上架"];
    }
    
    
    //    HWerweiMaFenXiangView  *fenxiang = [[HWerweiMaFenXiangView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
    //     [kKeyWindow addSubview:fenxiang];
    //
    //    DLog(@"分享");
    //    DLog(@"%@",NSStringFromCGRect(self.view.frame));
    //    HWFenXiangGameView *FenXiang = [[HWFenXiangGameView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
    //    FenXiang.delegate = self;
    //    [kKeyWindow addSubview:FenXiang];
    
    
}




//- (void)navigaView  {
//
////    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
////    button.frame = CGRectMake(10,StatusBarHeight+17, 40, 17);
////    [button setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
////    [button addTarget:self action:@selector(buttonTap) forControlEvents:UIControlEventTouchUpInside];
////
////    [self.view addSubview:button];
////
////    UILabel *textlabel = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-70)/2, StatusBarHeight+17, 70, 17)];
////    textlabel.text = @"游戏详情";
////    textlabel.textAlignment =  NSTextAlignmentCenter;
////    textlabel.textColor = [UIColor whiteColor];
////    textlabel.font = [UIFont systemFontOfSize:16];
////    [self.view addSubview:textlabel];
//
//
//    UIView *backeview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 44+StatusBarHeight+5)];
//    backeview.backgroundColor = [UIColor whiteColor];
//    self.daohaView = backeview;
//
// //   backeview.alpha = 0.1;
//    [self.view addSubview:backeview];
//
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//    button.frame = CGRectMake(10,StatusBarHeight+3, 40, 44);
//    [button setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
//    [button addTarget:self action:@selector(buttonTap) forControlEvents:UIControlEventTouchUpInside];
//    self.fanhuiBut = button;
//   //  button.backgroundColor = [UIColor redColor];
//
//    [self.view  addSubview:button];
//
//    UILabel *textlabel = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-70)/2, StatusBarHeight+17, 70, 17)];
//    textlabel.text = @"游戏详情";
//    textlabel.textAlignment =  NSTextAlignmentCenter;
//    textlabel.textColor = [UIColor whiteColor];
//    textlabel.textColor = [UIColor whiteColor];
//    textlabel.font = [UIFont systemFontOfSize:16];
//    self.biatiuLabe  = textlabel;
//    [self.view  addSubview:textlabel];
//
//
//
//}
//
//
//
//
//- (void)buttonTap {
//
//    [self.navigationController popViewControllerAnimated:YES];
//}
//
//
//
//
//
//
//
//
////设置背景图
//- (void)shezhibeijingView {
//    UIView *beijiview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 193+StatusBarHeight)];
//    [self.hederView addSubview:beijiview];
//
//
//  //  UIImageView *imagView = [[UIImageView alloc]initWithFrame:CGRectMake(-kScreenW/2,-(800-(193+StatusBarHeight)), kScreenW*2, 800)];
//
//    UIImageView *imagView = [[UIImageView alloc]initWithFrame:CGRectMake(0,0, kScreenW, 193+StatusBarHeight)];
//   // UIImage *lashengimge  = [UIImage imageNamed:@"youxiangxiangqing"];
//    int N = 5;
//    NSUInteger r = arc4random_uniform(N) + 1;
//    NSString *icostr = [NSString stringWithFormat:@"game_bg%ld",r];
//
//    UIImage *lashengimge  = [UIImage imageNamed:icostr];
//    // UIImage *zuizhonimge  =  [lashengimge resizableImageWithCapInsets:UIEdgeInsetsMake(lashengimge.size.height*0.9, lashengimge.size.width*0.9, lashengimge.size.height*0.9, lashengimge.size.width*0.9)];
//   // imagView.layer.cornerRadius = kScreenW/2;
//  //  imagView.layer.masksToBounds =YES;
//    imagView.image = lashengimge;
//    [beijiview addSubview:imagView];
//
//}
//
//
//#pragma mark ---- 添加卡片
//
//- (void)addCardView {
//
//    self.kaPianView = [[UIView alloc]initWithFrame:CGRectMake(16, StatusBarHeight+17*3, kScreenW-32, 196)];
//    self.kaPianView.backgroundColor =[UIColor whiteColor];
//
//    self.kaPianView.layer.shadowColor = [UIColor colorWithRed:183/255.0 green:183/255.0 blue:183/255.0 alpha:0.35].CGColor;
//    self.kaPianView.layer.shadowOffset = CGSizeMake(0,0);
//    self.kaPianView.layer.shadowOpacity = 1;
//    self.kaPianView.layer.shadowRadius = 1;
//    self.kaPianView.layer.cornerRadius = 12;
//    self.kaPianView.layer.masksToBounds = YES;
//    self.kaPianView.clipsToBounds = NO;
//    [self.hederView addSubview:self.kaPianView];
//
//    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.kaPianView.width-13-44, 11, 44, 44)];
//    imageView.image  = [UIImage imageNamed:@"details_socre"];
//    [self.kaPianView addSubview:imageView];
//
//    UILabel *penfenlabel = [[UILabel alloc]initWithFrame:CGRectMake(self.kaPianView.width-13-44, 11, 44, 44)];
//    penfenlabel.text = @"8.9";
//    penfenlabel.font = [UIFont systemFontOfSize:10];
//    penfenlabel.textColor = [UIColor whiteColor];
//    penfenlabel.textAlignment  = NSTextAlignmentCenter;
//    self.penfenlabel = penfenlabel;
//    [self.kaPianView addSubview:penfenlabel];
//
//    UIView *shuxianView = [[UIView alloc]initWithFrame:CGRectMake(self.kaPianView.width-22-13, 0, 1, 11)];
//    shuxianView.backgroundColor = RGB( 38, 154, 155);
//    [self.kaPianView addSubview:shuxianView];
//
//    UIImageView  *icoimageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.kaPianView.width/2-29, 16, 58, 58)];
//     icoimageView.image  = [UIImage imageNamed:@"youxiangxiangqing"];
//    self.touxiangimageView = icoimageView;
//    icoimageView.layer.cornerRadius = 12;
//    icoimageView.layer.masksToBounds = YES;
//
//    [self.kaPianView addSubview:icoimageView];
//
//    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, icoimageView.bottom+10, self.kaPianView.width, 16)];
//    self.nameLabel.text = @"游戏加载失败";
//    self.nameLabel.font = [UIFont systemFontOfSize:10];
//    self.nameLabel.textColor = RGB(51, 51, 51);
//
//    self.nameLabel.textAlignment  = NSTextAlignmentCenter;
//    self.nameLabel.font = [UIFont systemFontOfSize:16];
//    [self.kaPianView addSubview: self.nameLabel];
//
//
//
//    self.contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(15,  self.nameLabel.bottom+8, self.kaPianView.width-30, 13)];
//    self.contentLabel.text = @"大小：436.36M| 网络.dia·角色";
//    self.contentLabel.textColor = RGB(102, 102, 102);
//    self.contentLabel.textAlignment  = NSTextAlignmentCenter;
//    self.contentLabel.font = [UIFont systemFontOfSize:13];
//    [self.kaPianView addSubview:self.contentLabel];
//    self.shujuBiaoqianArr = @[@"礼包",@"满V版",@"送Vip"];
//
//    UIView *biaiqnView = [[UIView alloc]initWithFrame:CGRectMake(self.kaPianView.width/2-(43*3+12)/2,self.contentLabel.bottom + 6, 43*3+12, 15)];
// //   biaiqnView.backgroundColor = [UIColor redColor];
//    [self.kaPianView addSubview:biaiqnView];
//
//    self.biaoqiLabelMuArr = [[NSMutableArray alloc]init];
//
//    for (int i = 0; i <  self.shujuBiaoqianArr.count ; i++) {
//
//        UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(43*i+6*i,0 , 43, 15)];
//        label1.text = self.shujuBiaoqianArr[i];
//        label1.textColor = RGB(255, 255, 255);
//        label1.textAlignment  = NSTextAlignmentCenter;
//        label1.font = [UIFont systemFontOfSize:8];
//        label1.backgroundColor = RGB(38, 154, 155);
//        label1.layer.cornerRadius = 3;
//        label1.layer.masksToBounds = YES;
//        label1.tag = i;
//        [biaiqnView addSubview:label1];
//
//
//        [self.biaoqiLabelMuArr addObject:label1];
//        if (i == 0 ) {
//              label1.backgroundColor = RGB(38, 154, 155);
//        } else if (i == 1) {
//
//              label1.backgroundColor = RGB(221, 101, 111);
//        } else {
//
//              label1.backgroundColor = RGB(89, 206, 159);
//        }
//
//    }
//
//    // 这个是下载数量和排行榜 的Uiview
//    UIView *hongSeView = [[UIView alloc]initWithFrame:CGRectMake(0, biaiqnView.bottom+8, self.kaPianView.width, 35)];
//
//    hongSeView.backgroundColor = [UIColor whiteColor];
////    hongSeView.layer.cornerRadius = 12;
////    hongSeView.layer.masksToBounds = YES;
//    [self.kaPianView addSubview:hongSeView];
//
//    UIView *fengexianview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW-32, 1)];
//    fengexianview.backgroundColor = RGB(237, 237, 237);
//   // fengexianview.backgroundColor = [UIColor redColor];
//    [hongSeView addSubview:fengexianview];
//
//    self.paiHangbangLabel = [[UILabel alloc]initWithFrame:CGRectMake(0,  5, self.kaPianView.width/2, 10)];
//    self.paiHangbangLabel.text = @"20";
//    self.paiHangbangLabel.textColor = RGB(51, 51, 51);
//     self.paiHangbangLabel.textAlignment  = NSTextAlignmentCenter;
//    self.paiHangbangLabel.font = [UIFont systemFontOfSize:10];
//    [hongSeView addSubview:self.paiHangbangLabel];
//
//    UILabel *rebangLabel  = [[UILabel alloc]initWithFrame:CGRectMake(0, self.paiHangbangLabel.bottom+10, self.kaPianView.width/2, 12)];
//    rebangLabel.text = @"充值折扣";
//    rebangLabel.textColor = RGB(51, 51, 51);
//    rebangLabel.textAlignment  = NSTextAlignmentCenter;
//    rebangLabel.font = [UIFont systemFontOfSize:12];
//    [hongSeView addSubview:rebangLabel];
//
//
//     self.xiazaiLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.kaPianView.width/2,  5, self.kaPianView.width/2, 10)];
//     self.xiazaiLabel.text = @"20";
//     self.xiazaiLabel.textColor = RGB(51, 51, 51);
//    self.xiazaiLabel.textAlignment  = NSTextAlignmentCenter;
//     self.xiazaiLabel.font = [UIFont systemFontOfSize:10];
//    self.xiazaiLabel.hidden = YES;
//    [hongSeView addSubview: self.xiazaiLabel];
//
//    UILabel *numberLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.kaPianView.width/2, self.paiHangbangLabel.bottom+10, self.kaPianView.width/2, 12)];
//    numberLabel.text = @"推荐指数";
//    numberLabel.textColor = RGB(51, 51, 51);
//    numberLabel.textAlignment  = NSTextAlignmentCenter;
//    numberLabel.font = [UIFont systemFontOfSize:12];
//    self.wangguoleLabel = numberLabel;
//    [hongSeView addSubview:numberLabel];
//
//
//    UIView *shugeshixuangView = [[UIView alloc]initWithFrame:CGRectMake(self.kaPianView.width/2, 5, 1, 35)];
//
//    //shuxianView.frame = CGRectMake(20, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>)
//    shugeshixuangView.backgroundColor = RGB(237, 237, 237);
//    //shugeshixuangView.backgroundColor = [UIColor yellowColor];
//
//    [hongSeView addSubview:shugeshixuangView];
//
//
//
//    self.cunchuArr = [[NSMutableArray alloc]init];
//
//
//       for (int i = 0 ; i < 5; i++) {
//
//
//           UIImageView *iamgeViewxie1 = [[UIImageView alloc]initWithFrame:CGRectMake(self.kaPianView.width/2+ (self.kaPianView.width/2-48)/2 + 8*i+2*i, 8,  8 , 8)];
//             iamgeViewxie1.image = [UIImage imageNamed:@"stars_ico"];
//             [hongSeView addSubview:iamgeViewxie1];
//
//           [self.cunchuArr addObject:iamgeViewxie1];
//
//
//
//
//       }
//
//
//
//
//
//
//
//
//
//
//}
//
//
//
//
//
//
//
//
//
//#pragma mark ------ UITableViewDelegate
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//
//    return  1;
//}
//
//
//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//
//
//    if (self.xuanzhongTag == 0 ) {
//
//        static NSString  *cellID = @"cellID";
//        HWGamexiangQingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//        if (!cell) {
//            cell  = [[HWGamexiangQingTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//        }
//        cell.selectionStyle =  UITableViewCellSelectionStyleNone;
//        cell.backgroundColor = [UIColor whiteColor];
//        cell.dataDic = self.xiangqngDic;
//        NSString *str = self.xiangqngDic[@"content"];
//
//        // NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍！";
//
//        //  NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍";
//        //  NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人";
//        cell.zhangkan = self.zhangkai;
//        // 用这个数据刷新的这个单元个数据
//        cell.dataStr = str;
//        return  cell;
//
//    } else if (self.xuanzhongTag == 1) {
//
//
//        static NSString  *cellID = @"KaifucellID";
//
//        HWKaiFuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//
//        if (!cell) {
//            cell = [[HWKaiFuTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//
//        }
//
//        cell.dataArr = self.kaifuData;
//        cell.gameId = self.gameId;
//        cell.selectionStyle =  UITableViewCellSelectionStyleNone;
//
//
//        return  cell;
//
//    } else if (self.xuanzhongTag == 2) {
//
//        static NSString  *cellID = @"JiaoyicellID";
//        HWQCJiaoYiTableViewCell  *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//        if (!cell) {
//            cell = [[HWQCJiaoYiTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//
//        }
//        cell.backgroundColor = [UIColor whiteColor];
//        cell.backgroundColor = [UIColor redColor];
//        cell.gameId = self.gameId;
//
//
//        return  cell;
//
//
//    }else {
//
//        static NSString  *cellID = @"cellID";
//        HWGamexiangQingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//        if (!cell) {
//            cell  = [[HWGamexiangQingTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//        }
//        cell.selectionStyle =  UITableViewCellSelectionStyleNone;
//
//        NSString *str = @"《宠物精灵宝可梦》是一款免费集强大！";
//
//        // NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍！";
//
//        //  NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍";
//        //  NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人";
//
//
//        cell.zhangkan = self.zhangkai;
//        cell.dataStr = str;
//        return  cell;
//
//    }
//
//
//
//
//
//
//
//
//}
//
//
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
//
//
//    if (self.xuanzhongTag == 0) {
//
//        NSString *str = self.xiangqngDic[@"content"];
//
//        NSArray *liaArr  = self.xiangqngDic[@"lb"];
//
//        int libao = [liaArr  count];
//
//        CGFloat  contentH = [self calculateRowHeight:str fontSize:12];
//        if (libao == 0 ) {
//             return 180*CFLScaleValue+36+10+contentH+3+75*CFLScaleValue+6+(70+6)+58*CFLScaleValue+21+6+36*4+40;
//        }
//
//        return  180*CFLScaleValue+36+10+contentH+3+75*CFLScaleValue+6+(70+6)*libao+58*CFLScaleValue+21+6+36*4+40;
//
//
//        //  return  180*CFLScaleValue+36+10+contentH+3+75*CFLScaleValue+6+(70+6)*3+58*CFLScaleValue+21+6+36*4+40+200;
//    } else if (self.xuanzhongTag == 1) {
//
//
//        return  kScreenH - (StatusBarHeight+17*3+196+5+44+TabbarSafeBottomMargin);
//
//
//        if (self.kaifuData.count > 0) {
//             return  300+36;
//        }
//
//        return  124 +33 + 9 +12 ;
//
//
//
//
//      //  return  300+36;
//
//
//    } else if (self.xuanzhongTag == 2) {
//
//        return  kScreenH - (StatusBarHeight+17*3+196+5+44+TabbarSafeBottomMargin);
//
//
//    }else {
//
//
//
//    }
//
//    // contentH+3
//    NSString *str = @"《宠物精灵宝可梦》是一款免费集强大！";
//    CGFloat  contentH = [self calculateRowHeight:str fontSize:12];
//    return  180*CFLScaleValue+36+10+contentH+3+75*CFLScaleValue+6+(70+6)*3+58*CFLScaleValue+21+6+36*4;
//
//
//
//
//}
//
//
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
//
//    return  40;
//
//
//}
//
//- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
//
//    return  1;
//
//
//}
//
//
//- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
//
//    UIView *view =  [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 1)];
//    return  view;
//
//
//}
//- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
//
//    if (section == 0) {
//        UIView *viewheade = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 40)];
//        viewheade.backgroundColor = [UIColor whiteColor];
//        NSArray *array = @[@"详情",@"开服",@"交易"];
//
//        UIView *xiahuaxiview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 66, 3)];
//        xiahuaxiview.backgroundColor = RGB(34, 141, 255);
//        [viewheade addSubview:xiahuaxiview];
//
//        CGFloat jiaju = (kScreenW - 3*66)/6;
//        for (int i = 0; i < array.count; i++) {
//            UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
//            button.tag = i;
//           // i = ((i * 2)-1)
//            [button setTitle:array[i] forState:UIControlStateNormal];
//            button.frame  = CGRectMake(i*66 + (i * 2)*jiaju+jiaju, 0, 66, 37);
//            button.titleLabel.font  = [UIFont systemFontOfSize:13];
//            button.backgroundColor = [UIColor whiteColor];
//            // button.titleLabel.textColor = RGB(50, 50, 50);
//            [button setTitleColor:RGB(51, 51, 51) forState:UIControlStateNormal];
//            [viewheade addSubview:button];
//
//            [button addTarget:self action:@selector(selectedTap:) forControlEvents:UIControlEventTouchUpInside];
//
//
//            if (i == self.xuanzhongTag) {
//                [button setTitleColor:RGB(34, 141, 255) forState:UIControlStateNormal];
//               // [button setBackgroundImage:[UIImage imageNamed:@"QCxuanzhong"] forState:UIControlStateNormal];
//                self.xuanzhongBut = button;
//
//                xiahuaxiview.frame = CGRectMake(i*66 + (i * 2)*jiaju+jiaju, 37, 66, 3);
//
//            }
//
//
//
//        }
//
//        return viewheade;
//
//    } else {
//        UIView *viewheade = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 65)];
//        viewheade.backgroundColor = [UIColor whiteColor];
//
//
//        NSArray *array = @[@"youxiang_dating",@"kaifubia",@"home_QCb3"];
//        CGFloat jiajue  = (kScreenW - 110 * 3-28)/2;
//        for (int i = 0; i < array.count; i++) {
//
//            UIImageView *imaview = [[UIImageView alloc]initWithFrame:CGRectMake(110*i+jiajue*i+14, 5, 110, 55)];
//            imaview.image = [UIImage imageNamed:array[i]];
//            [viewheade addSubview:imaview];
//
//        }
//
//        return viewheade;
//    }
//
//
//
//
//
//}
//
//- (void)selectedTap:(UIButton *)sender {
//
//    [self.xuanzhongBut setTitleColor:RGB(51, 51, 51) forState:UIControlStateNormal];
//    //[self.xuanzhongBut setBackgroundImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
//
////    [sender setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
////    [sender setBackgroundImage:[UIImage imageNamed:@"QCxuanzhong"] forState:UIControlStateNormal];
//    self.xuanzhongBut = sender;
//    self.xuanzhongTag = (int)sender.tag;
//    [self.mainaTableVie reloadData];
//
//
//}
//
//
//
//
////- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
////
////    UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 0.01)];
////    footerView.backgroundColor = [UIColor whiteColor];
////    return footerView;
////
////}
//
//
//#pragma mark  ------------  计算文字的高度
//
//
//- (CGFloat)calculateRowHeight:(NSString *)string fontSize:(NSInteger)fontSize
//
//{
//
//    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]};
//
//    CGRect rect = [string boundingRectWithSize:CGSizeMake(kScreenW-36, MAXFLOAT)/*计算高度要先指定宽度*/ options:NSStringDrawingUsesLineFragmentOrigin |
//
//                   NSStringDrawingUsesFontLeading attributes:dic context:nil];
//
//    return rect.size.height;
//
//}
//
- (void)xuazhongTag:(int )tap {
    
    
    //  self.listArr = @[@"微信",@"朋友圈",@"QQ",@"QQ空间"];
    
    
    
    
    
    
    if (tap == 0) {
        // 微信
        SDWebImageManager *manager =[SDWebImageManager sharedManager];
        //根据URLString去下载图片
        NSString *URLString =   self.topModel.icon ;
        __weak typeof(self) weakSelf = self;
        
        [manager loadImageWithURL:[NSURL URLWithString:URLString] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
            
        } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
            
            if (finished) {
                
                NSLog(@" shuju %@",image);
                
                
                
                
                NSString *utf8String =[NSString stringWithFormat:@"%@&member_id=%@",self.topModel.fenxiang,[HWLocallyStoredData getCode]];
                
                
                // NSString *utf8String1 = [NSString stringWithFormat:@"%@?ct=shouyou&ac=info&gid=%@",[HWGlobalConst baseUrl],self.mowanDic[@"id"]];
                
                
                
                
                NSString *title =self.topModel.name;
                NSString *description = [NSString stringWithFormat:@"%@%@",self.topModel.name,self.topModel.type];
                
                //创建发送对象实例
                SendMessageToWXReq *sendReq = [[SendMessageToWXReq alloc] init];
                sendReq.bText = NO;//不使用文本信息
                sendReq.scene = 0;
                // 发送到聊天界面  0
                // 发送到朋友圈    1
                // 发送到微信收藏  2
                //创建分享内容对象
                WXMediaMessage *urlMessage = [WXMediaMessage message];
                urlMessage.title = title;//分享标题 urlMessage.description = @"";
                urlMessage.description= description;
                
                //分享描述
                [urlMessage setThumbImage:image];
                //分享图片,使用SDK的setThumbImage方法可压缩图片大小
                //创建多媒体对象
                WXWebpageObject *webObj = [WXWebpageObject object];
                webObj.webpageUrl = utf8String;//分享链接
                
                //完成发送对象实例
                urlMessage.mediaObject = webObj;
                sendReq.message = urlMessage;
                //发送分享信息
//                [WXApi sendReq:sendReq];
                [WXApi sendReq:sendReq completion:^(BOOL success) {
                                    
                }];
                
                
                
                
                
                
            }
            
            
        }];
        
        
        
        
    } else if (tap == 1) {
        // 朋友圈
        
        
        SDWebImageManager *manager =[SDWebImageManager sharedManager];
        //根据URLString去下载图片
        NSString *URLString = self.topModel.icon;
        __weak typeof(self) weakSelf = self;
        [manager loadImageWithURL:[NSURL URLWithString:URLString] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
            
        } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
            
            if (finished) {
                
                NSLog(@" shuju %@",image);
                
                
                
                
                NSString *utf8String =[NSString stringWithFormat:@"%@&member_id=%@",self.topModel.fenxiang,[HWLocallyStoredData getCode]];
                
                NSString *title = self.topModel.name;
                NSString *description = [NSString stringWithFormat:@"%@%@",self.topModel.name,self.topModel.type];
                
                //创建发送对象实例
                SendMessageToWXReq *sendReq = [[SendMessageToWXReq alloc] init];
                sendReq.bText = NO;//不使用文本信息
                sendReq.scene = 1;
                // 发送到聊天界面  0
                // 发送到朋友圈    1
                // 发送到微信收藏  2
                //创建分享内容对象
                WXMediaMessage *urlMessage = [WXMediaMessage message];
                urlMessage.title = title;//分享标题 urlMessage.description = @"";
                urlMessage.description= description;
                
                //分享描述
                [urlMessage setThumbImage:image];
                //分享图片,使用SDK的setThumbImage方法可压缩图片大小
                //创建多媒体对象
                WXWebpageObject *webObj = [WXWebpageObject object];
                webObj.webpageUrl = utf8String;//分享链接
                
                //完成发送对象实例
                urlMessage.mediaObject = webObj;
                sendReq.message = urlMessage;
                //发送分享信息
//                [WXApi sendReq:sendReq];
                
                [WXApi sendReq:sendReq completion:^(BOOL success) {
                                    
                }];
                
                
                
                
                
            }
            
            
        }];
        
        
    }else if (tap == 2) {
        //QQ
        
        
        NSString *utf8String =[NSString stringWithFormat:@"%@&member_id=%@",self.topModel.fenxiang,[HWLocallyStoredData getCode]];
        
        NSString *title = self.topModel.name;
        NSString *description = [NSString stringWithFormat:@"%@%@",self.topModel.name,self.topModel.type];
        
        NSString *previewImageUrl = self.topModel.icon; ;
        QQApiNewsObject *newsObj = [QQApiNewsObject
                                    objectWithURL:[NSURL URLWithString:utf8String]
                                    title:title
                                    description:description
                                    previewImageURL:[NSURL URLWithString:previewImageUrl]];
        req = [SendMessageToQQReq reqWithContent:newsObj];
        
        
        QQApiSendResultCode sent = [QQApiInterface sendReq:req];
        
        
        
        
        
    }else if (tap == 3) {
        
        //QQ空间
        
        NSString *utf8String =[NSString stringWithFormat:@"%@&member_id=%@",self.topModel.fenxiang,[HWLocallyStoredData getCode]];
        
        NSString *title = self.topModel.name;
        NSString *description = [NSString stringWithFormat:@"%@%@",self.topModel.name,self.topModel.type];
        
        NSString *previewImageUrl = self.topModel.icon;
        QQApiNewsObject *newsObj = [QQApiNewsObject
                                    objectWithURL:[NSURL URLWithString:utf8String]
                                    title:title
                                    description:description
                                    previewImageURL:[NSURL URLWithString:previewImageUrl]];
        req = [SendMessageToQQReq reqWithContent:newsObj];
        
        
        //    QQApiSendResultCode sent = [QQApiInterface sendReq:req];
        
        QQApiSendResultCode sent = [QQApiInterface SendReqToQZone:req];
        
        
        
        
    }
    
    
    
    
    
    
}
//
//
//
//
//// 点击收藏按钮
- (void)shoucangcollection {
    
    NSString *uid = [HWLocallyStoredData getLoginUserID];
    NSString *tString = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    NSString *gidStr = [NSString stringWithFormat:@"%@",self.gameId];
    NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uid,tString,@"fsd213ewdsadqwe2121213edsad"];
    NSString *signMD5 = [WMUtil md5HexDigest:signStr];
    
    NSString *type = @"0";
    
    NSDictionary *parametes = @{
        @"uid":uid,
        @"t":tString,
        @"sign":signMD5,
        @"id":gidStr,
        @"type":type,
        @"ios" : @"1",
        @"ct":@"app",
        @"type":@"0",
        @"ac":@"shoucang_add"};
    
    
    
    
    
    
    
    //  [MBProgressHUD show:@"正在收藏"];
    
    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
        
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        
        if ([codeStr intValue] == 1) {
            // [MBProgressHUD showMessage:@"收藏成功" toView:self.view];
            
            //  [MBProgressHUD showSuccess:@"收藏成功"];
            self.shouCangBut.selected = YES;
            [self topGameDetails];
            
            
            
        } else {
            
            
            // [MBProgressHUD showError:@"收藏失败"];
            [MBProgressHUD showError:response[@"message"]];
            
        }
        
        
        
    } failure:^(NSString *error) {
        
        
        [MBProgressHUD showError:@"收藏失败"];
        
    }];
    
    
    
    
    
    
}
// 取消收藏

- (void)quexiaoCollection {
    
    
    
    
    NSString *uid = [HWLocallyStoredData getLoginUserID];
    NSString *tString = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
    NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uid,tString,@"fsd213ewdsadqwe2121213edsad"];
    NSString *signMD5 = [WMUtil md5HexDigest:signStr];
    NSString *idStr = self.topModel.shoucang_id;
    
    
    
    
    
    NSDictionary *parametes = @{
        @"uid":uid,
        @"t":tString,
        @"sign":signMD5,
        @"id": idStr,
        @"ios" : @"1",
        @"ct":@"app",
        @"type":@"0",
        @"ac":@"shoucang_del"};
    
    
    
    
    
    [MBProgressHUD show:@"取消收藏"];
    
    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
        
        
        
        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
        
        if ([codeStr intValue] == 1) {
            // [MBProgressHUD showMessage:@"收藏成功" toView:self.view];
            
            [MBProgressHUD showSuccess:@"取消收藏成功"];
            self.shouCangBut.selected = YES;
            [self topGameDetails];
            
            
        } else {
            
            
            // [MBProgressHUD showError:@"收藏失败"];
            [MBProgressHUD showError:response[@"message"]];
            
        }
        
        
    } failure:^(NSString *error) {
        
        
        [MBProgressHUD showSuccess:@"取消收藏失败"];
        
    }];
    
    
    
    
    
    
    
    
    
}
//
//
//
//- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
//
//    NSLog(@"变化 %f ---- %f",scrollView.contentOffset.x,scrollView.contentOffset.y);
//
//    if (scrollView.contentOffset.y  > 100 ) {
//
//        self.daohaView.hidden = NO;
//        self.biatiuLabe.textColor = RGB(51, 51, 51);
//
//        [self.fanhuiBut setImage:[UIImage imageNamed:@"detailshei_back"] forState:UIControlStateNormal];
//
//
//
//    } else if (scrollView.contentOffset.y  < 5) {
//
//
//
//         self.daohaView.hidden = YES;
//
//         [self.fanhuiBut setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
//         self.biatiuLabe.textColor = RGB(255, 255, 255);
//
//
//    }
//
//
//}



@end




#pragma mark ------- 以前代码

//#import "HWGameDetailsViewController.h"
//#import "HWGamexiangQingTableViewCell.h"
//#import "HWKaiFuTableViewCell.h"
//#import "HWQCJiaoYiTableViewCell.h"
//#import "HWFenXiangGameView.h"
//#import "HWDetailsTopModel.h" // 游戏详情顶部
//#import "HWLoginController.h" // 登录
//#import "HWWebViewGameViewController.h"
//#import "HWerweiMaFenXiangView.h"
//
//#import <TencentOpenAPI/TencentOAuth.h>
//#import <TencentOpenAPI/QQApiInterface.h>
//#import <TencentOpenAPI/QQApiInterfaceObject.h>
//#import "WXApi.h"
//#import "HWlibaoxiangqingTableViewCell.h"
//
//#import "HWlibaoxiangqingjiemianModel.h"
//
//
//#import "HWpinglunjiemianQCTableViewCell.h"
//
//
//
//
//
//
//@interface HWGameDetailsViewController ()<UITableViewDelegate,UITableViewDataSource,HWFenXiangGameViewDelegate>
//{
//    
//    
//     SendMessageToQQReq *req;
//     NSString *member_id; //推广id
//    
//}
//
//
//
//
//
//
//
//@property(strong,nonatomic) UITableView *mainaTableVie;
//@property(strong,nonatomic) UIView *hederView;
//
//// 这一块是那个卡片Uiview
//@property(strong,nonatomic) UIView *kaPianView; //游戏卡片
//@property(strong,nonatomic) UILabel *penfenlabel; // 评分
//@property(strong,nonatomic) UIImageView *touxiangimageView; // 头像
//@property(strong,nonatomic) UILabel *nameLabel;
//@property(strong,nonatomic) UILabel *contentLabel;
//@property(strong,nonatomic) NSMutableArray *biaoqiLabelMuArr;
//@property(strong,nonatomic) NSArray *shujuBiaoqianArr;
//@property(strong,nonatomic) UILabel *paiHangbangLabel; // 排行榜
//@property(strong,nonatomic) UILabel *xiazaiLabel; // 下载
//@property(strong,nonatomic) UILabel *wangguoleLabel; // 玩过了
//
////添加底部Uiview
//@property(strong,nonatomic)UIView *lowerPartView;
//// 这个用来判断
//@property(assign,nonatomic) int xuanzhongTag;
//@property(strong,nonatomic) UIButton *xuanzhongBut;
//@property(assign,nonatomic) BOOL zhangkai;
////开服测试数据
//@property(strong,nonatomic) NSArray *kaifuData;
//// 顶部模型
//@property(strong,nonatomic) HWDetailsTopModel *topModel;
//
////详情字典
//@property(strong,nonatomic) NSDictionary *xiangqngDic; // 详情字典
//@property(strong,nonatomic) UIButton *shouCangBut; // 收藏
//@property(strong,nonatomic) UIButton *downloadBut; // 下载按钮
//
//
//// 导航的三个控件
//@property(strong,nonatomic) UIView *daohaView;
//@property(strong,nonatomic) UIButton *fanhuiBut;
//@property(strong,nonatomic) UILabel *biatiuLabe;
//@property(strong,nonatomic) NSMutableArray  *libaoshujdataMuArr;
//
//// 评论接口
//@property(strong,nonatomic)NSMutableArray *commentsMutableArr;
//@property(assign,nonatomic) CGFloat pinglungaodu;
//
//@property(strong,nonatomic) NSMutableArray *cunchuArr;
//
//
//
//
//
//
//
//@end
//
//@implementation HWGameDetailsViewController
//
//-(UITableView *)mainaTableVie {
//    
//    if  (_mainaTableVie == nil) {
//        
//        _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight, kScreenW, kScreenH+StatusBarHeight-44-TabbarSafeBottomMargin) style:UITableViewStyleGrouped];
//        // _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH-44) style:UITableViewStylePlain];
//        _mainaTableVie.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
//        _mainaTableVie.delegate = self;
//        _mainaTableVie.dataSource = self;
//        _mainaTableVie.separatorStyle = UITableViewCellSeparatorStyleNone;
//        _mainaTableVie.backgroundColor = [UIColor whiteColor];
//    }
//    
//    
//    return   _mainaTableVie;
//    
//}
//
//
//- (void)viewWillAppear:(BOOL)animated {
//    [super viewWillAppear:animated];
//    
//    [self.navigationController setNavigationBarHidden:YES animated:animated];
//    
//    [self topGameDetails];
//    
//}
//
//- (void)viewWillDisappear:(BOOL)animated {
//    [super viewWillDisappear:animated];
//    
//    [self.navigationController setNavigationBarHidden:NO animated:animated];
//    
//    
//    
//}
//
//
//- (void)viewDidLoad {
//    [super viewDidLoad];
//    self.automaticallyAdjustsScrollViewInsets = YES;
//    
//    
//    
//    [self youxipingluanjiekou];
//    
//    // 设置常用的属性
//    [self setupAttribute];
//    
//    // Do any additional setup after loading the view.
//    [self setUpUI];
//    
//    [self listeningNSNotificationCenter];
//    
//    // 请求礼包数据
//    [self libaofasongwangluoqingqiu];
//    
//    //详情顶部
//    [self topGameDetails];
//    
//    // 详情
//    [self xiangqingmiaoshu];
//    
//    
// 
//    
//    
//    
//    
//    
//    
//    
//}
//
//
//
//
//
//
//
//
//
//// 游戏评论接口
//- (void)youxipingluanjiekou {
//    
//    
//    
//         NSString *userID = [HWLocallyStoredData getLoginUserID];
//           NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
//           NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
//           NSString *signMD5 = [WMUtil md5HexDigest:sign];
//    
//        // 659
//
//         NSDictionary *parametes = @{
//                                          @"ct" :  @"app",
//                                          @"ac" : @"game_pinglun",
//                                          @"ios" : @"1",
//                                          @"t":tStr,
//                                          @"uid":userID,
//                                          @"sign":signMD5,
//                                          @"id":self.gameId,
//                                          @"member_id":[HWLocallyStoredData getCode],
//                                    
//                                          
//                                    
//                                          };
//              
//              
//            
//              
//              [HWWebUtils do3GetWithParameters:parametes progress:nil success:^(id response) {
//                  
//                  
//                  NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//                 
//                
//                  [MBProgressHUD hideHUD];
//                  
//                
//                  
//                  
//                  if ([codeStr intValue] == 1) {
//                    //  [MBProgressHUD  showError:@"加载成功"];
//                       //    NSArray *arr = response[@"data"];
//                      
//                      
//                      self.commentsMutableArr = response[@"data"];
//                      
//                      
//                      [self jisuanpinglundegaodu];
//                      
//                      
//                      
//                      
//                      [self.mainaTableVie reloadData];
//                      
//
//                    
//                      
//                      
//                  } else {
//                      
//                  
//                      
//               
//                      
//                  }
//                  NSLog(@"%@",response);
//                  
//                  
//              } failure:^(NSString *error) {
//                  
//                 
//                  
//                  
//              }];
//        
//    
//    
//    
//    
//}
//
//// 计算评论的高度
//- (void)jisuanpinglundegaodu {
//     // 56 + 5
//    self.pinglungaodu = 0;
//    for (int i = 0; i < self.commentsMutableArr.count; i++) {
//        
//        
//      NSDictionary *dic = self.commentsMutableArr[i];
//      NSString *jiajing = [NSString stringWithFormat:@"%@",dic[@"jiajing"]];
//        NSString   *contentStr = @"";
//      if ([jiajing intValue] == 1) {
//        
//        
//       contentStr = [NSString stringWithFormat:@"                %@",dic[@"content"]];
//      
//        
//        
//    } else {
//    
//        
//             contentStr = [NSString stringWithFormat:@"%@",dic[@"content"]];
//      
//        
//    }
//        
//        
//        
//         CGFloat  contentH = [self  jisuncalculateRowHeight:contentStr fontSize:12];
//        
//        self.pinglungaodu = contentH+56+5 +self.pinglungaodu;
//        
//        
//        
//        
//        
//        
//        
//        
//        
//        
//        
//}
//    
//    
//    
//    
//}
//
//
//
//
//
//
//
//// 游戏评论接口
//- (void)addpinglunyouxipinglunjiekou {
//    
//    
//    
//    NSString *userID = [HWLocallyStoredData getLoginUserID];
//             NSString *tStr = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
//             NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
//             NSString *signMD5 = [WMUtil md5HexDigest:sign];
//      
//          // 659
//
//           NSDictionary *parametes = @{
//                                            @"ct" :  @"app",
//                                            @"ac" : @"add_pinglun",
//                                            @"ios" : @"1",
//                                            @"t":tStr,
//                                            @"uid":userID,
//                                            @"sign":signMD5,
//                                            @"id":self.gameId,
//                                            @"member_id":[HWLocallyStoredData getCode],
//                                            @"content": @"jdnjnjjnjndfjnjjdnjdnjnjjnjndfjnjvdfjdfjjdnjnjjnjndfjnjvdfjdfjjdnjnjjnjndfjnjvdfjdfjjnjjnjndfjnjvdfjdfjjdnjnjjnjndfjnjvdfjdfjjdnjnjjnjndfjnjvdfjdfjjdnjnjjnjndfjnjvdfjdfjvdfjdfj",
//                                            
//                                      
//                                            };
//                
//                
//              
//                
//                [HWWebUtils do3GetWithParameters:parametes progress:nil success:^(id response) {
//                    
//                    
//                    NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//                   
//                  
//                    [MBProgressHUD hideHUD];
//                    
//                  
//                    
//                    
//                    if ([codeStr intValue] == 1) {
//                      //  [MBProgressHUD  showError:@"加载成功"];
//                         //    NSArray *arr = response[@"data"];
//                        
//                        [self.mainaTableVie reloadData];
//                        
//
//                      
//                        
//                        
//                    } else {
//                        
//                        self.libaoshujdataMuArr = [[NSMutableArray alloc]init];
//                        
//                    //      [MBProgressHUD showError:response[@"message"]];
//                        
//                        
//                        
//                       //  [self.maincollectionView reloadData];
//                     
//                        
//                    }
//                    NSLog(@"%@",response);
//                    
//                    
//                } failure:^(NSString *error) {
//                    
//                   
//                    
//                    
//                }];
//    
//    
//    
//    
//    
//}
//
//
//
//
//
//
//- (void)libaofasongwangluoqingqiu  {
//    
//    
//    
//    
//    
//          NSDictionary *parametes = @{
//                                      @"ct" :  @"app",
//                                      @"ac" : @"game_lb",
//                                      @"ios" : @"1",
//                                      @"member_id":[HWLocallyStoredData getCode],
//                                      @"gid": self.gameId,
//                                      
//                                      };
//          
//          
//        
//          
//          [HWWebUtils do3GetWithParameters:parametes progress:nil success:^(id response) {
//              
//              
//              NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//             
//            
//              [MBProgressHUD hideHUD];
//              
//            
//              
//              
//              if ([codeStr intValue] == 1) {
//                //  [MBProgressHUD  showError:@"加载成功"];
//                   //    NSArray *arr = response[@"data"];
//                self.libaoshujdataMuArr = [HWlibaoxiangqingjiemianModel mj_objectArrayWithKeyValuesArray:response[@"data"][@"list"]];
////
////    //                  self.p = [NSString stringWithFormat:@"%@",response[@"p"]];
////    //
////    //                  self.max_p = [NSString stringWithFormat:@"%@",response[@"max_p"]];
////    //
////                      [self.maincollectionView reloadData];
////
// //                  NSString *iconStr = response[@"data"][@"icon"];
//
// //                  [self.icoIamgeView sd_setImageWithURL:[NSURL URLWithString:iconStr] placeholderImage:nil];
//                  
////                  self.biatiuLabe.text = [NSString stringWithFormat:@"%@",response[@"data"][@"name"]];
////
////                  self.mingchenglabel.text = [NSString stringWithFormat:@"%@",response[@"data"][@"name"]];
////
////                  [self.starsBut setTitle:[NSString stringWithFormat:@"%@ %@",response[@"data"][@"point"],response[@"data"][@"type"]] forState:UIControlStateNormal];
////
////                   [self.starsBut layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleLeft imageTitleSpace:3];
//                  
//                  [self.mainaTableVie reloadData];
//                  
//
//                
//                  
//                  
//              } else {
//                  
//                  self.libaoshujdataMuArr = [[NSMutableArray alloc]init];
//                  
//              //      [MBProgressHUD showError:response[@"message"]];
//                  
//                  
//                  
//                 //  [self.maincollectionView reloadData];
//               
//                  
//              }
//              NSLog(@"%@",response);
//              
//              
//          } failure:^(NSString *error) {
//              
//             
//              
//              
//          }];
//    
//    
//    
//    
//}
//
//
//
//
//// 详情顶部
//- (void)topGameDetails {
//    
//     
//    NSDictionary *parametes  = nil;
//    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//        
//        parametes = @{
//                                                  @"id" : self.gameId,
//                                                  @"ios" : @"1",
//                                                  @"ct" :  @"app",
//                                                  @"ac" : @"game_info",
//                                                        @"member_id":[HWLocallyStoredData getCode]
//                                                  };
//        
//        
//    } else {
//               parametes = @{
//                                            @"id" : self.gameId,
//                                            @"ios" : @"1",
//                                            @"uid" : [HWLocallyStoredData getLoginUserID],
//                                            @"ct" : @"app",
//                                            @"member_id":[HWLocallyStoredData getCode],
//                                            @"ac" : @"game_info"
//                                            };
//        
//    }
//       
//      
//    
//    
//      [MBProgressHUD showMessage:@"正在加载" toView:nil mobanshezhi:YES];
//      
//      [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
//          
//         
//          
//          NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//          
//          [MBProgressHUD hideHUD];
//          
//          if ([codeStr intValue] == 1) {
//              
//              HWDetailsTopModel *mdel = [HWDetailsTopModel mj_objectWithKeyValues:response[@"data"]];
//              
//             
//              
//              self.topModel = mdel;
//              
//              if ([self.topModel.shoucang isEqualToString:@"0"]) {
//                    self.shouCangBut.selected = NO;
//
//              } else {
//                               
//                    self.shouCangBut.selected = YES;
//                               
//
//              }
//              
//              
//              NSURL *icoUrl = [NSURL URLWithString:self.topModel.icon];
//              [self.touxiangimageView sd_setImageWithURL:icoUrl];
//              
//              // zhekou
//           //   self.penfenlabel.text = [NSString stringWithFormat:@"%@",mdel.point];
//               self.penfenlabel.text = [NSString stringWithFormat:@"%@",mdel.point];
//              
//              if ([mdel.point intValue] == 5) {
//                  
//              } else if ([mdel.point intValue] == 4) {
//                  UIImageView  *label1 =   self.cunchuArr[4];
//                  label1.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                  
//                 //  label1.hidden = YES;
//                  
//                  
//              }else if ([mdel.point intValue] == 3) {
//                  
//                  
//                  UIImageView  *label1 =   self.cunchuArr[4];
//                  //  label1.hidden = YES;
//                                 
//                  UIImageView *label2 =   self.cunchuArr[3];
//                               //  label2.hidden = YES;
//                  
//                   label1.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                    label2.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                  
//                                 
//                  
//              }else if ([mdel.point intValue] == 2) {
//                  
//                  
//                  
//                             UIImageView *label1 =   self.cunchuArr[4];
//                             //   label1.hidden = YES;
//                                            
//                             UIImageView *label2 =   self.cunchuArr[3];
//                                 //            label2.hidden = YES;
//                  
//                  
//                        UIImageView *label3 =   self.cunchuArr[2];
//                  
//                  
//                    label1.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                    label2.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                    label3.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                  
//                  
//                  
//                  
//                       //   label3.hidden = YES;
//                  
//                  
//              }else if ([mdel.point intValue] == 1) {
//                  
//                  
//                        UIImageView *label1 =   self.cunchuArr[4];
//                        UIImageView *label2 =   self.cunchuArr[3];
//                        UIImageView *label3 =   self.cunchuArr[2];
//                        UIImageView *label4 =   self.cunchuArr[1];
//                  
//                  
//                   label1.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                    label2.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                    label3.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                   label4.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                  
//                  
//                   
//                            
//                  
//                  
//              } else {
//                  
//                  
//                  UIImageView *label1 =   self.cunchuArr[4];
//                                   
//                                                                   
//                  UIImageView *label2 =   self.cunchuArr[3];
//                                                               
//                                         
//                                         
//                  UIImageView *label3 =   self.cunchuArr[2];
//                                            
//                               
//                  UIImageView *label4 =   self.cunchuArr[1];
//                                //  label4.hidden = YES;
//                  UIImageView *label5 =   self.cunchuArr[0];
//                                           //      label5.hidden = YES;
//                  
//                  
//                  label1.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                   label2.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                    label3.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                    label4.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                                  
//                    label5.image = [UIImage imageNamed:@"pingfen_weixuanzhong"];
//                                         
//                  
//                  
//              }
//              
//              
//              
//              self.nameLabel.text = [NSString stringWithFormat:@"%@",self.topModel.name];
//              
//              
//              NSString *daxiao = [HWjianzhiduiObject keylocalization:@"大小"];
//              
//              self.contentLabel.text = [NSString stringWithFormat:@"%@：%@M | %@",daxiao,self.topModel.size,self.topModel.type];
//              
//              self.contentLabel.hidden = NO;
//              
//              
//              for (int i = 0 ; i < self.topModel.biaoqian.count; i++) {
//                  
//                  UILabel *label = (UILabel *)self.biaoqiLabelMuArr[i];
//                  label.text = self.topModel.biaoqian[i];
//                  
//                  
//              }
//              self.xiazaiLabel.text = [NSString stringWithFormat:@"%@",self.topModel.number];
//              
//             // paihang
//             // self.paiHangbangLabel.text = [NSString stringWithFormat:@"%@",self.topModel.paihang];
//              self.paiHangbangLabel.text = [NSString stringWithFormat:@"%@",self.topModel.zhekou];
//              
//               
//              NSString *xiazai =  [HWjianzhiduiObject keylocalization:@"立即下载"];
//              NSString *dakai = [HWjianzhiduiObject keylocalization:@"打开"];
//              
//               //  游戏系统 1安卓 2IOS 3双端   system 字段的意思
//              if ([self.topModel.system isEqualToString:@"1"] ) {
//                  
//                  
//                
//                  [self.downloadBut setTitle:xiazai forState:UIControlStateNormal];
//                  
//              } else {
//                  
//                   //   1 手机游戏 2 H5游戏
//                  
//                  if ([self.topModel.system_type isEqualToString:@"1"]) {
//                      //   1 手机游戏
//                      [self.downloadBut setTitle:xiazai forState:UIControlStateNormal];
//                      
//                  } else  if ([self.topModel.system_type isEqualToString:@"2"]){
//                      
//                       // 2 H5游戏
//                       [self.downloadBut setTitle:dakai forState:UIControlStateNormal];
//                      
//    
//                        self.contentLabel.text = [NSString stringWithFormat:@"%@",self.topModel.summary];
//                       // self.contentLabel.hidden = YES;
//                        self.wangguoleLabel.text = @"玩过了";
//                      
//                  } else {
//                      
//                      [self.downloadBut setTitle:xiazai forState:UIControlStateNormal];
//                      
//                      
//                  }
//                  
//                  
//                  
//              }
//              
//              
//            
//          } else {
//              
//              
//              [MBProgressHUD showError:response[@"message"]];
//              
//          }
//       
//          
//          
//      } failure:^(NSString *error) {
//        
//          [MBProgressHUD hideHUD];
//      }];
//      
//    
//    
//    
//}
//
//
//
//
//
//
//
//// 详情的接口
//- (void)xiangqingmiaoshu {
//    
//    
//    NSDictionary *parametes  = nil;
//    if ([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//        
//        parametes = @{
//                                                  @"id" : self.gameId,
//                                                  @"ios" : @"1",
//                                                  @"ct" :  @"app",
//                                                  @"ac" : @"game_info1"
//                                                  };
//        
//        
//    } else {
//        
//        
//              parametes = @{
//                                            @"id" : self.gameId,
//                                            @"ios" : @"1",
//                                            @"uid" : [HWLocallyStoredData getLoginUserID],
//                                            @"ct" : @"app",
//                                            @"ac" : @"game_info1"
//                                            };
//        
//        
//    }
//       
//      
//      
//    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
//          
//         
//          
//          NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//          
//          if ([codeStr intValue] == 1) {
//              NSLog(@"%@",response);
//              
//              
//              
//              self.xiangqngDic = response[@"data"];
//              [self.mainaTableVie reloadData];
//              
//              
//              
//        
//          } else {
//              
//              
//              [MBProgressHUD showError:response[@"message"]];
//              
//          }
//       
//          // 阴阳
//          
//      } failure:^(NSString *error) {
//        
//          
//      }];
//    
//    
//    
//}
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//#pragma  mark ------- 监听通知
//- (void)listeningNSNotificationCenter {
//    
//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshTableView:) name:@"xianqingtongzhSentimentOnTheSlide" object:nil];
//    
//    
//    
//}
//
//- (void)refreshTableView:(NSNotification *)noti {
//    
//    NSLog(@"%@",noti.userInfo);
//    NSDictionary *dic = noti.userInfo;
//    NSString *str  = [NSString stringWithFormat:@"%@",dic[@"rolling"]];
//    int  a = [str intValue];
//    // judgeStr
//    if (a == 1) {
//        
//        self.zhangkai = YES;
//        
//        [self.mainaTableVie reloadData];
//        
//
//        
//    } else {
//        
//        self.zhangkai = NO;
//         [self.mainaTableVie reloadData];
//    }
//    
//    
//}
//
////  设置常用的属性
//- (void)setupAttribute {
//    self.zhangkai = NO;
//    self.xuanzhongTag = 0;
//    self.kaifuData = @[@"1ii1i",@"ihdsbuh"];
//   // self.kaifuData = [[NSArray alloc]init];
//    
//}
//
//
//
//// 设置UI
//- (void)setUpUI {
//    
//    self.view.backgroundColor = [UIColor whiteColor];
//    
//    
//    [self.view addSubview:self.mainaTableVie];
//    UIView *hederview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, StatusBarHeight+17*3+196+5)];
//    hederview.backgroundColor  = [UIColor redColor];
//    hederview.backgroundColor = RGB(248, 248, 248);
//    self.hederView = hederview;
//    self.mainaTableVie.tableHeaderView = hederview;
//    
//    // 返回按钮
//    [self navigaView];
//    
//    //设置背景图
//    [self shezhibeijingView];
//    
//    //  添加卡片Uiview
//    [self addCardView];
//        
//    //添加底部Uiview
//    [self addLowerPartView];
//
//}
//
//
//
//
//// 添加低部UIview
//- (void)addLowerPartView {
//    
//    self.lowerPartView = [[UIView alloc]initWithFrame:CGRectMake(0, kScreenH-44-CF_TabbarSafeBottomMargin, kScreenW, 44+CF_TabbarSafeBottomMargin)];
//    // self.lowerPartView.backgroundColor = [UIColor yellowColor];
//    self.lowerPartView.backgroundColor = [UIColor whiteColor];
//    [self.view addSubview:self.lowerPartView];
//    
//    UIButton *butt  = [UIButton setButtonWithFrame:CGRectMake(65, 7, kScreenW-65*2, 30) Title:@"立即下载" Image:nil Font:13 Color:RGB(255, 255, 155) Target:self Selector:@selector(buttonTap:)];
//    self.downloadBut = butt;
//    butt.backgroundColor = RGB(38, 154, 255);
//    butt.layer.cornerRadius = 15;
//     butt.layer.masksToBounds = YES;
//     [self.lowerPartView addSubview:butt];
//    
//    
//    self.downloadBut.backgroundColor = [UIColor bm_colorGradientChangeWithSizeView: self.downloadBut];
//    
//    
//    NSString *shoucang = [HWjianzhiduiObject keylocalization:@"收藏"];
//    
//    
//    UIButton *butt1  = [UIButton setButtonWithFrame:CGRectMake(7, 0, 50, 44) Title:shoucang Image:@"details_sellect_a" Font:10 Color:RGB(178, 178, 178) Target:self Selector:@selector(shoucangTap:)];
//    [butt1 setImage:[UIImage imageNamed:@"details_sellect_b"] forState:UIControlStateSelected];
//    self.shouCangBut = butt1;
//    // butt1.backgroundColor = RGB(38, 154, 255);
//    [butt1 layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:5];
//    [self.lowerPartView addSubview:butt1];
//    
//    
//    NSString *fenxiang = [HWjianzhiduiObject keylocalization:@"分享"];
//    UIButton *butt2  = [UIButton setButtonWithFrame:CGRectMake(kScreenW-65+7, 0, 50, 44) Title:fenxiang Image:@"details_share_a" Font:10 Color:RGB(178, 178, 178) Target:self Selector:@selector(fenxiangTap:)];
//    // butt1.backgroundColor = RGB(38, 154, 255);
//    [butt2 layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleTop imageTitleSpace:5];
//    [self.lowerPartView addSubview:butt2];
//    
//
//}
//
//
//
//
//
//#pragma mark -----  点击立即下载按钮
//- (void)buttonTap:(UIButton *)sender {
//    
//    
//    
//    
//    
//           NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
//                                  
//            NSString *path2 = [NSString stringWithFormat:@"%@/%@", bundlePath, @"coid"];
//
//                     NSFileManager *manager = [NSFileManager defaultManager];
//
//             //        NSString *channel = @"";
//
//
//                    NSString *channel = [NSString string];
//                     if ([manager fileExistsAtPath:path2]) {
//                         NSArray *allPath =[manager subpathsAtPath:path2];
//                         //4.遍历所有的子路径
//                         for (NSString *subPath in allPath) {
//                             if ([subPath containsString:@"coid_"]) {
//                                 channel = [subPath substringFromIndex:@"coid_".length];
//                                 NSLog(@"文件夹名字%@+++",  channel);
//                             }
//                         }
//                     }
//                     if ([channel isEqual:@""]) {
//                         member_id = [NSString stringWithFormat:@"0"];
//                     } else {
//                         member_id = [NSString stringWithFormat:@"%@",channel];
//                     }
//                     NSLog(@"有值吗++%@+++", member_id);
//    
//    
//    
//    
//    
//    
//    
//    
////    if([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
////
////
////         HWLoginController *log = [[HWLoginController alloc]init];
////         [self.navigationController pushViewController:log animated:YES];
////
////     } else {
////
////         NSLog(@"111立即下载");
////
////         //  游戏系统 1安卓 2IOS 3双端   system 字段的意思
////         if ([self.topModel.system isEqualToString:@"1"] ) {
////
////
////             [MBProgressHUD showError:@"此游戏没有IOS版本"];
////
////
////
////
////          } else {
////
////              //   1 手机游戏 2 H5游戏
////
////            if ([self.topModel.system_type isEqualToString:@"1"]) {
////                //   1 手机游戏
////
////
////                if(self.topModel.ios.length > 0) {
////
////                     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.topModel.ios]];
////
////                } else {
////
////                    [MBProgressHUD showError:@"此游戏暂未上架"];
////                }
////                // [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.topModel.ios]];
////
////
////
////
////
////            } else  if ([self.topModel.system_type isEqualToString:@"2"]){
////
////                    // 2 H5游戏
////                //  NSString *url = [NSString stringWithFormat:@"https://www.baidu.com"];
////
////                NSString *userID = [HWLocallyStoredData getLoginUserID];
////
////                int t =    [WMUtil getRandomNumber:101 to:998];
////                 NSString *tStr = [NSString stringWithFormat:@"%ld%d",[WMUtil getTimeSp],t];
////                 NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
////                 NSString *signMD5 = [WMUtil md5HexDigest:sign];
////
////
////                  NSString *url = [NSString stringWithFormat:@"%@?ct=h5login&gid=%@&uid=%@&type=1&t=%@&sign=%@", [HWGlobalConst baseUrl], self.gameId,[HWLocallyStoredData getLoginUserID],tStr,signMD5];
////
////                  HWWebViewGameViewController *webview = [[HWWebViewGameViewController alloc]init];
////                  webview.urlString = url;
////                  webview.gname = self.topModel.name;
////                  webview.hidesBottomBarWhenPushed = YES;
////                  [self.navigationController pushViewController:webview animated:YES];
////
////
////
////            } else {
////
////                  [MBProgressHUD showError:@"此游戏暂未上架"];
////
////
////            }
////
////
////
////        }
////
////
////
////
////
////
////     }
//    
//      
//    
//  
//          NSLog(@"111立即下载");
//          
//          //  游戏系统 1安卓 2IOS 3双端   system 字段的意思
//          if ([self.topModel.system isEqualToString:@"1"] ) {
//              
//              
//              [MBProgressHUD showError:@"此游戏没有IOS版本"];
//              
//              
//                        
//           } else {
//                        
//               //   1 手机游戏 2 H5游戏
//                        
//             if ([self.topModel.system_type isEqualToString:@"1"]) {
//                 //   1 手机游戏
//                 
//                 
//                 
//                 if ([member_id isEqualToString:@"0"]) {
//                     
//
//                     
//                 } else {
//                     
//                     
//                     
//                     
//                         if([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//                     
//                     
//                              HWLoginController *log = [[HWLoginController alloc]init];
//                              [self.navigationController pushViewController:log animated:YES];
//                              return;
//                             
//                        
//                     
//                          }
//                     
//                     
//                     
//     
//                     
//                     
//                 }
//
//                            
//                 
//                 if(self.topModel.ios.length > 0) {
//                     
//                      [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.topModel.ios]];
//                     
//                 } else {
//                     
//                     [MBProgressHUD showError:@"此游戏暂未上架"];
//                 }
//                 // [[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.topModel.ios]];
//                 
//                 
//                 
//                 
//                 
//             } else  if ([self.topModel.system_type isEqualToString:@"2"]){
//                            
//                     // 2 H5游戏
//                 //  NSString *url = [NSString stringWithFormat:@"https://www.baidu.com"];
//                 
//                 
//                if([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//                 
//                 
//                          HWLoginController *log = [[HWLoginController alloc]init];
//                          [self.navigationController pushViewController:log animated:YES];
//                          return;
//                         
//                 
//                }
//                 
//                 
//                 
//                 
//                 
//                 NSString *userID = [HWLocallyStoredData getLoginUserID];
//                 
//                 int t =    [WMUtil getRandomNumber:101 to:998];
//                  NSString *tStr = [NSString stringWithFormat:@"%ld%d",[WMUtil getTimeSp],t];
//                  NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
//                  NSString *signMD5 = [WMUtil md5HexDigest:sign];
//                 
//                 
//                   NSString *url = [NSString stringWithFormat:@"%@?ct=h5login&gid=%@&uid=%@&type=1&t=%@&sign=%@", [HWGlobalConst baseUrl], self.gameId,[HWLocallyStoredData getLoginUserID],tStr,signMD5];
//                 
//                   HWWebViewGameViewController *webview = [[HWWebViewGameViewController alloc]init];
//                   webview.urlString = url;
//                   webview.gname = self.topModel.name;
//                   webview.hidesBottomBarWhenPushed = YES;
//                   [self.navigationController pushViewController:webview animated:YES];
//                 
//         
//             
//             } else {
//                            
//                   [MBProgressHUD showError:@"此游戏暂未上架"];
//                            
//                            
//             }
//                        
//                        
//                        
//         }
//          
//          
//    
//           
//}
//
//// 点击收藏按钮
//- (void)shoucangTap:(UIButton *)sender {
//    
//    
//    if([[HWLocallyStoredData getLoginUserID] isEqualToString:@""]) {
//        HWLoginController *log = [[HWLoginController alloc]init];
//        [self.navigationController pushViewController:log animated:YES];
//        
//    } else {
//        
//        
//
//        NSLog(@"1111   %@",self.topModel.shoucang);
//        
//        if ([self.topModel.shoucang isEqualToString:@"0"]) {
//            
//            // 收藏
//            [self shoucangcollection];
//            
//            
//        }  else  {
//         
//            // 取消收藏
//            [self quexiaoCollection];
//            
//            
//            
//        }
//        
//
//        
//    }
//    
//    
////    if (sender.selected) {
////        sender.selected = NO;
////
////    } else {
////         sender.selected = YES;
////
////    }
//    DLog(@"lmjopojp");
//    
//}
//
//
//
//
//
//
//
//
//
//
//// 分享
//- (void)fenxiangTap:(UIButton *)sender {
//    
//    
////    [MBProgressHUD showError:@"此功能暂未开通"];
////    return;
////
//    
//    
////    HWFenXiangGameView *FenXiang = [[HWFenXiangGameView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
////     FenXiang.delegate = self;
////     [kKeyWindow addSubview:FenXiang];
////
////     return ;
//
//    
//    
//    
//    
//    
//    if(self.topModel.ios.length > 0) {
//                      
//        HWerweiMaFenXiangView  *fenxiang = [[HWerweiMaFenXiangView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
//        fenxiang.urlStr = self.topModel.ios;
//        [kKeyWindow addSubview:fenxiang];
//        
// 
//                      
//    } else {
//        
//        //
//        
//          if ([self.topModel.system_type isEqualToString:@"2"] ) {
//                 
//                 NSString *userID = [HWLocallyStoredData getLoginUserID];
//                                       
//                       int t =    [WMUtil getRandomNumber:101 to:998];
//                 NSString *tStr = [NSString stringWithFormat:@"%ld%d",[WMUtil getTimeSp],t];
//                 NSString *sign = [NSString stringWithFormat:@"%@%@%@",userID,tStr,@"fsd213ewdsadqwe2121213edsad"];
//                 NSString *signMD5 = [WMUtil md5HexDigest:sign];
//                                  
//                  NSString *url = [NSString stringWithFormat:@"%@?ct=h5login&gid=%@&member_id=%@", [HWGlobalConst baseUrl], self.gameId,[HWLocallyStoredData getCode]];
//                
//                  HWerweiMaFenXiangView  *fenxiang = [[HWerweiMaFenXiangView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
//                 fenxiang.urlStr =url;
//                 [kKeyWindow addSubview:fenxiang];
//              
//              
//                 
//                 
//             } else {
//                 
//                  [MBProgressHUD showError:@"此游戏暂未上架"];
//             }
//             
//                      
//              //   [MBProgressHUD showError:@"此游戏暂未上架"];
//    }
//    
//    
////    HWerweiMaFenXiangView  *fenxiang = [[HWerweiMaFenXiangView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
////     [kKeyWindow addSubview:fenxiang];
////
////    DLog(@"分享");
////    DLog(@"%@",NSStringFromCGRect(self.view.frame));
////    HWFenXiangGameView *FenXiang = [[HWFenXiangGameView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, kScreenH)];
////    FenXiang.delegate = self;
////    [kKeyWindow addSubview:FenXiang];
//     
//    
//}
//
//
//
//
//- (void)navigaView  {
//   
////    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
////    button.frame = CGRectMake(10,StatusBarHeight+17, 40, 17);
////    [button setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
////    [button addTarget:self action:@selector(buttonTap) forControlEvents:UIControlEventTouchUpInside];
////
////    [self.view addSubview:button];
////
////    UILabel *textlabel = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-70)/2, StatusBarHeight+17, 70, 17)];
////    textlabel.text = @"游戏详情";
////    textlabel.textAlignment =  NSTextAlignmentCenter;
////    textlabel.textColor = [UIColor whiteColor];
////    textlabel.font = [UIFont systemFontOfSize:16];
////    [self.view addSubview:textlabel];
//    
//    
//    UIView *backeview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 44+StatusBarHeight+5)];
//    backeview.backgroundColor = [UIColor whiteColor];
//    self.daohaView = backeview;
//    
// //   backeview.alpha = 0.1;
//    [self.view addSubview:backeview];
//    
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//    button.frame = CGRectMake(10,StatusBarHeight+3, 40, 44);
//    [button setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
//    [button addTarget:self action:@selector(buttonTap) forControlEvents:UIControlEventTouchUpInside];
//    self.fanhuiBut = button;
//    [self.view  addSubview:button];
//    
//    UILabel *textlabel = [[UILabel alloc]initWithFrame:CGRectMake((kScreenW-90)/2, StatusBarHeight+17, 90, 17)];
//    textlabel.text = @"游戏详情";
//    textlabel.text  = [HWjianzhiduiObject keylocalization:@"游戏详情"];
//    
//    textlabel.textAlignment =  NSTextAlignmentCenter;
//    textlabel.textColor = [UIColor whiteColor];
//    textlabel.textColor = [UIColor whiteColor];
//    textlabel.font = [UIFont systemFontOfSize:16];
//    self.biatiuLabe  = textlabel;
//    [self.view  addSubview:textlabel];
//    
//    
//    
//    
//    
//    
//}
//
//
//
//
//
//
//
//
//
//
//
//- (void)buttonTap {
//    
//    [self.navigationController popViewControllerAnimated:YES];
//}
//
//
//
//
//
//
//
//
////设置背景图
//- (void)shezhibeijingView {
//    UIView *beijiview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 193+StatusBarHeight)];
//    [self.hederView addSubview:beijiview];
//    
//  
//  //  UIImageView *imagView = [[UIImageView alloc]initWithFrame:CGRectMake(-kScreenW/2,-(800-(193+StatusBarHeight)), kScreenW*2, 800)];
//    
//    UIImageView *imagView = [[UIImageView alloc]initWithFrame:CGRectMake(0,0, kScreenW, 193+StatusBarHeight)];
//   // UIImage *lashengimge  = [UIImage imageNamed:@"youxiangxiangqing"];
//    int N = 5;
//    NSUInteger r = arc4random_uniform(N) + 1;
//    NSString *icostr = [NSString stringWithFormat:@"game_bg%ld",r];
//    
//    UIImage *lashengimge  = [UIImage imageNamed:icostr];
//    // UIImage *zuizhonimge  =  [lashengimge resizableImageWithCapInsets:UIEdgeInsetsMake(lashengimge.size.height*0.9, lashengimge.size.width*0.9, lashengimge.size.height*0.9, lashengimge.size.width*0.9)];
//   // imagView.layer.cornerRadius = kScreenW/2;
//  //  imagView.layer.masksToBounds =YES;
//    imagView.image = lashengimge;
//    [beijiview addSubview:imagView];
//    
//}
//
//
//#pragma mark ---- 添加卡片
//
//- (void)addCardView {
//    
//    self.kaPianView = [[UIView alloc]initWithFrame:CGRectMake(16, StatusBarHeight+17*3, kScreenW-32, 196)];
//    self.kaPianView.backgroundColor =[UIColor whiteColor];
//    
//    self.kaPianView.layer.shadowColor = [UIColor colorWithRed:183/255.0 green:183/255.0 blue:183/255.0 alpha:0.35].CGColor;
//    self.kaPianView.layer.shadowOffset = CGSizeMake(0,0);
//    self.kaPianView.layer.shadowOpacity = 1;
//    self.kaPianView.layer.shadowRadius = 1;
//    self.kaPianView.layer.cornerRadius = 12;
//    self.kaPianView.layer.masksToBounds = YES;
//    self.kaPianView.clipsToBounds = NO;
//    [self.hederView addSubview:self.kaPianView];
//    
//    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.kaPianView.width-13-44, 11, 44, 44)];
//    imageView.image  = [UIImage imageNamed:@"details_socre"];
//    [self.kaPianView addSubview:imageView];
//    
//    UILabel *penfenlabel = [[UILabel alloc]initWithFrame:CGRectMake(self.kaPianView.width-13-44, 11, 44, 44)];
//    penfenlabel.text = @"8.9";
//    penfenlabel.font = [UIFont systemFontOfSize:10];
//    penfenlabel.textColor = [UIColor whiteColor];
//    penfenlabel.textAlignment  = NSTextAlignmentCenter;
//    self.penfenlabel = penfenlabel;
//    [self.kaPianView addSubview:penfenlabel];
//    
//    UIView *shuxianView = [[UIView alloc]initWithFrame:CGRectMake(self.kaPianView.width-22-13, 0, 1, 11)];
//    shuxianView.backgroundColor = RGB( 38, 154, 155);
//    [self.kaPianView addSubview:shuxianView];
//    
//    UIImageView  *icoimageView = [[UIImageView alloc]initWithFrame:CGRectMake(self.kaPianView.width/2-29, 16, 58, 58)];
//     icoimageView.image  = [UIImage imageNamed:@"youxiangxiangqing"];
//    self.touxiangimageView = icoimageView;
//    icoimageView.layer.cornerRadius = 12;
//    icoimageView.layer.masksToBounds = YES;
//    
//    [self.kaPianView addSubview:icoimageView];
//    
//    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, icoimageView.bottom+10, self.kaPianView.width, 16)];
//    self.nameLabel.text = @"游戏加载失败";
//    self.nameLabel.font = [UIFont systemFontOfSize:10];
//    self.nameLabel.textColor = RGB(51, 51, 51);
//    
//    self.nameLabel.textAlignment  = NSTextAlignmentCenter;
//    self.nameLabel.font = [UIFont systemFontOfSize:16];
//    [self.kaPianView addSubview: self.nameLabel];
//    
//    
//    
//    self.contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(15,  self.nameLabel.bottom+8, self.kaPianView.width-30, 13)];
//    self.contentLabel.text = @"大小：436.36M| 网络.dia·角色";
//    self.contentLabel.textColor = RGB(102, 102, 102);
//    self.contentLabel.textAlignment  = NSTextAlignmentCenter;
//    self.contentLabel.font = [UIFont systemFontOfSize:13];
//    [self.kaPianView addSubview:self.contentLabel];
//    self.shujuBiaoqianArr = @[@"礼包",@"满V版",@"送Vip"];
//    
//    UIView *biaiqnView = [[UIView alloc]initWithFrame:CGRectMake(self.kaPianView.width/2-(43*3+12)/2,self.contentLabel.bottom + 6, 43*3+12, 15)];
// //   biaiqnView.backgroundColor = [UIColor redColor];
//    [self.kaPianView addSubview:biaiqnView];
//    
//    self.biaoqiLabelMuArr = [[NSMutableArray alloc]init];
//    
//    for (int i = 0; i <  self.shujuBiaoqianArr.count ; i++) {
//        
//        UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(43*i+6*i,0 , 43, 15)];
//        label1.text = self.shujuBiaoqianArr[i];
//        label1.textColor = RGB(255, 255, 255);
//        label1.textAlignment  = NSTextAlignmentCenter;
//        label1.font = [UIFont systemFontOfSize:8];
//        label1.backgroundColor = RGB(38, 154, 155);
//        label1.layer.cornerRadius = 3;
//        label1.layer.masksToBounds = YES;
//        label1.tag = i;
//        [biaiqnView addSubview:label1];
//        
//        
//        [self.biaoqiLabelMuArr addObject:label1];
//        if (i == 0 ) {
//              label1.backgroundColor = RGB(38, 154, 155);
//        } else if (i == 1) {
//            
//              label1.backgroundColor = RGB(221, 101, 111);
//        } else {
//            
//              label1.backgroundColor = RGB(89, 206, 159);
//        }
//        
//    }
//    
//    // 这个是下载数量和排行榜 的Uiview
//    UIView *hongSeView = [[UIView alloc]initWithFrame:CGRectMake(0, biaiqnView.bottom+8, self.kaPianView.width, 35)];
//    
//    hongSeView.backgroundColor = [UIColor whiteColor];
////    hongSeView.layer.cornerRadius = 12;
////    hongSeView.layer.masksToBounds = YES;
//    [self.kaPianView addSubview:hongSeView];
//    
//    UIView *fengexianview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW-32, 1)];
//    fengexianview.backgroundColor = RGB(237, 237, 237);
//   // fengexianview.backgroundColor = [UIColor redColor];
//    [hongSeView addSubview:fengexianview];
//    
//    self.paiHangbangLabel = [[UILabel alloc]initWithFrame:CGRectMake(0,  5, self.kaPianView.width/2, 10)];
//    self.paiHangbangLabel.text = @"20";
//    self.paiHangbangLabel.textColor = RGB(51, 51, 51);
//     self.paiHangbangLabel.textAlignment  = NSTextAlignmentCenter;
//    self.paiHangbangLabel.font = [UIFont systemFontOfSize:10];
//    [hongSeView addSubview:self.paiHangbangLabel];
//    
//    UILabel *rebangLabel  = [[UILabel alloc]initWithFrame:CGRectMake(0, self.paiHangbangLabel.bottom+10, self.kaPianView.width/2, 12)];
//    rebangLabel.text = @"充值折扣";
//    rebangLabel.textColor = RGB(51, 51, 51);
//    rebangLabel.textAlignment  = NSTextAlignmentCenter;
//    rebangLabel.font = [UIFont systemFontOfSize:12];
//    [hongSeView addSubview:rebangLabel];
//    rebangLabel.text = [HWjianzhiduiObject keylocalization:@"充值折扣"];
//    
//    
//     self.xiazaiLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.kaPianView.width/2,  5, self.kaPianView.width/2, 10)];
//     self.xiazaiLabel.text = @"20";
//     self.xiazaiLabel.textColor = RGB(51, 51, 51);
//    self.xiazaiLabel.textAlignment  = NSTextAlignmentCenter;
//     self.xiazaiLabel.font = [UIFont systemFontOfSize:10];
//    self.xiazaiLabel.hidden = YES;
//    [hongSeView addSubview: self.xiazaiLabel];
//    
//    
//    
//    
//    
//    UILabel *numberLabel  = [[UILabel alloc]initWithFrame:CGRectMake(self.kaPianView.width/2, self.paiHangbangLabel.bottom+10, self.kaPianView.width/2, 12)];
//    numberLabel.text = @"推荐指数";
//    numberLabel.text =  [HWjianzhiduiObject keylocalization:@"推荐指数"];
//    numberLabel.textColor = RGB(51, 51, 51);
//    numberLabel.textAlignment  = NSTextAlignmentCenter;
//    numberLabel.font = [UIFont systemFontOfSize:12];
//    self.wangguoleLabel = numberLabel;
//    [hongSeView addSubview:numberLabel];
//    
//    
//    UIView *shugeshixuangView = [[UIView alloc]initWithFrame:CGRectMake(self.kaPianView.width/2, 5, 1, 35)];
//    
//    //shuxianView.frame = CGRectMake(20, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>)
//    shugeshixuangView.backgroundColor = RGB(237, 237, 237);
//    //shugeshixuangView.backgroundColor = [UIColor yellowColor];
//    [hongSeView addSubview:shugeshixuangView];
//    
//    
//    
//    self.cunchuArr = [[NSMutableArray alloc]init];
//    
//    
//    for (int i = 0 ; i < 5; i++) {
//
//
//        UIImageView *iamgeViewxie1 = [[UIImageView alloc]initWithFrame:CGRectMake(self.kaPianView.width/2+ (self.kaPianView.width/2-48)/2 + 8*i+2*i, 8,  8 , 8)];
//          iamgeViewxie1.image = [UIImage imageNamed:@"stars_ico"];
//          [hongSeView addSubview:iamgeViewxie1];
//        
//        [self.cunchuArr addObject:iamgeViewxie1];
//        
//        
//        
//
//    }
//
////    UIImageView *iamgeView = [[UIImageView alloc]initWithFrame:CGRectMake( self.kaPianView.width/2 + 8*i+5*i, 5,  8 , 8)];
////    iamgeView.image = [UIImage imageNamed:@"stars_ico"];
////    [hongSeView addSubview:imageView];
//     
//    
//   
//}
//
//
//
//
//
//
//
//
//
//#pragma mark ------ UITableViewDelegate
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//    
//    return  1;
//}
//
//
//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//    
//    
//    if (self.xuanzhongTag == 0 ) {
//        
//        static NSString  *cellID = @"cellID";
//        HWGamexiangQingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//        if (!cell) {
//            cell  = [[HWGamexiangQingTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//        }
//        cell.selectionStyle =  UITableViewCellSelectionStyleNone;
//        cell.backgroundColor = [UIColor whiteColor];
//        cell.pinglunMuArr = self.commentsMutableArr;
//        cell.gaodutablViewH = self.pinglungaodu;
//        cell.idStr = self.gameId;
//        
//        
//        cell.dataDic = self.xiangqngDic;
//        NSString *str = self.xiangqngDic[@"content"];
//        
//        // NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍！";
//        
//        //  NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍";
//        //  NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人";
//        cell.zhangkan = self.zhangkai;
//        // 用这个数据刷新的这个单元个数据
//        cell.dataStr = str;
//    
//        return  cell;
//        
//    } else if (self.xuanzhongTag == 1) {
//        
//        
//        static NSString  *cellID = @"KaifucellID";
//    
//        HWKaiFuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//        
//        if (!cell) {
//            cell = [[HWKaiFuTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//            
//        }
//    
//        cell.dataArr = self.kaifuData;
//        cell.gameId = self.gameId;
//        cell.selectionStyle =  UITableViewCellSelectionStyleNone;
//    
//        
//        return  cell;
//        
//    } else if (self.xuanzhongTag == 2) {
//        
//        static NSString  *cellID = @"JiaoyicellID";
//        HWQCJiaoYiTableViewCell  *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//        if (!cell) {
//            cell = [[HWQCJiaoYiTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//            
//        }
//        cell.backgroundColor = [UIColor whiteColor];
//        cell.backgroundColor = [UIColor redColor];
//        cell.gameId = self.gameId;
//    
//        
//        return  cell;
//        
//    
//    } else if (self.xuanzhongTag == 3) {
//        
//         static NSString  *cellID = @"libaocellID";
//        
//        HWlibaoxiangqingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//    
//        if (!cell) {
//             
//            
//            cell = [[HWlibaoxiangqingTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//            
//            
//        }
//        
//        cell.dataMuArr = self.libaoshujdataMuArr;
//        
//        [cell shuxingshuju];
//        
//        
//        
//        cell.backgroundColor = RGB(247, 247, 247);
//    
//        return cell;
//        
//        
//        
//        
//    } else if (self.xuanzhongTag == 4) {
//        
//        
//          static NSString  *cellID = @"pinglunlonmg";
//        HWpinglunjiemianQCTableViewCell  *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//        
//        if (!cell) {
//             cell =  [[HWpinglunjiemianQCTableViewCell  alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//            
//        }
//        
//        
//        
//        
//        return cell;
//        
//        
//        
//        
//    }else {
//        
//        static NSString  *cellID = @"cellID";
//        HWGamexiangQingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
//        if (!cell) {
//            cell  = [[HWGamexiangQingTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
//        }
//        cell.selectionStyle =  UITableViewCellSelectionStyleNone;
//        
//        NSString *str = @"《宠物精灵宝可梦》是一款免费集强大！";
//        
//        // NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍！";
//        
//        //  NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人公立志成为一名神奇宝贝大师，收集强大的精灵打造属于自己的强大队伍";
//        //  NSString *str = @"《宠物精灵宝可梦》是一款免费的放置类卡牌游戏，保留了经典的回合制对战策略，主人";
//        cell.zhangkan = self.zhangkai;
//        cell.dataStr = str;
//        
//        return  cell;
//    
//    }
//    
//    
//    
//  
//   
//    
//    
//    
//}
//
//
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
//    
//    
//    if (self.xuanzhongTag == 0) {
//        
//        NSString *str = self.xiangqngDic[@"content"];
//        
//        NSArray *liaArr  = self.xiangqngDic[@"lb"];
//        
//        int libao = [liaArr  count];
//        
//        CGFloat  contentH = [self calculateRowHeight:str fontSize:12];
//        
//   
//        
//        
//        
//        if (libao == 0 ) {
//            
//           
//            
//             return 180*CFLScaleValue+36+10+contentH+3+75*CFLScaleValue+6+(70+6)+58*CFLScaleValue+21+6+36*4+40+  self.pinglungaodu+40;
//        }
//
//        return  180*CFLScaleValue+36+10+contentH+3+75*CFLScaleValue+6+(70+6)*libao+58*CFLScaleValue+21+6+36*4+40+ self.pinglungaodu+40;
//        
//    
//        //  return  180*CFLScaleValue+36+10+contentH+3+75*CFLScaleValue+6+(70+6)*3+58*CFLScaleValue+21+6+36*4+40+200;
//    } else if (self.xuanzhongTag == 1) {
//        
//        
//        return  kScreenH - (StatusBarHeight+17*3+196+5+44+TabbarSafeBottomMargin);
//        
//        
//        if (self.kaifuData.count > 0) {
//             return  300+36;
//        }
//        
//        return  124 +33 + 9 +12 ;
//        
//        
//        
//        
//      //  return  300+36;
//        
//        
//    } else if (self.xuanzhongTag == 2) {
//        
//        return  kScreenH - (StatusBarHeight+17*3+196+5+44+TabbarSafeBottomMargin);
//        
//        
//    } else if (self.xuanzhongTag == 3) {
//        
//        
//        if (self.libaoshujdataMuArr.count > 0 ) {
//            
//            CGFloat a  = 450;
//            
//            if ((self.libaoshujdataMuArr.count* 92)> 450 ) {
//                
//                return self.libaoshujdataMuArr.count*92;
//                 
//            } else {
//                
//                
//                
//                
//                return  a;
//                
//            }
//            
//            
//            
//            
//            
//             
//        }
//        
//        
//        return  450 ;
//        
//        
//        
//        
//    } else if ( self.xuanzhongTag == 4 ) {
//        
//        
//        return   100;
//        
//        
//        
//        
//        
//        
//    }else {
//        
//        
//        
//    }
//    
//    // contentH+3
//    NSString *str = @"《宠物精灵宝可梦》是一款免费集强大！";
//    CGFloat  contentH = [self calculateRowHeight:str fontSize:12];
//    return  180*CFLScaleValue+36+10+contentH+3+75*CFLScaleValue+6+(70+6)*3+58*CFLScaleValue+21+6+36*4;
//    
//    
//    
//
//}
//
//
//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
//    
//    return  40;
//    
//    
//}
//
//- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
//    
//    return  1;
//    
//    
//}
//
//
//- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
//    
//    UIView *view =  [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 1)];
//    return  view;
//    
//    
//}
//- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
//    
//    if (section == 0) {
//        UIView *viewheade = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 40)];
//        viewheade.backgroundColor = [UIColor whiteColor];
//       //  NSArray *array = @[@"详情",@"开服",@"交易",@"礼包"];
//        NSArray *array = @[[HWjianzhiduiObject keylocalization:@"详情"],[HWjianzhiduiObject keylocalization:@"开服"],[HWjianzhiduiObject keylocalization:@"交易"],[HWjianzhiduiObject keylocalization:@"礼包"]];
//        
//        
//        UIView *xiahuaxiview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 66, 3)];
//        xiahuaxiview.backgroundColor = RGB(34, 141, 255);
//        [viewheade addSubview:xiahuaxiview];
//        
//        CGFloat jiaju = (kScreenW - 4*50)/8;
//        for (int i = 0; i < array.count; i++) {
//            UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
//            button.tag = i;
//           // i = ((i * 2)-1)
//            [button setTitle:array[i] forState:UIControlStateNormal];
//            button.frame  = CGRectMake(i*50 + (i * 2)*jiaju+jiaju, 0, 50, 37);
//            button.titleLabel.font  = [UIFont systemFontOfSize:13];
//            button.backgroundColor = [UIColor whiteColor];
//            // button.titleLabel.textColor = RGB(50, 50, 50);
//            [button setTitleColor:RGB(51, 51, 51) forState:UIControlStateNormal];
//            [viewheade addSubview:button];
//    
//            [button addTarget:self action:@selector(selectedTap:) forControlEvents:UIControlEventTouchUpInside];
//            
//           
//            if (i == self.xuanzhongTag) {
//                [button setTitleColor:RGB(34, 141, 255) forState:UIControlStateNormal];
//               // [button setBackgroundImage:[UIImage imageNamed:@"QCxuanzhong"] forState:UIControlStateNormal];
//                self.xuanzhongBut = button;
//                
//                xiahuaxiview.frame = CGRectMake(i*50 + (i * 2)*jiaju+jiaju, 37, 50, 3);
//                
//            }
//            
//            
//            
//        }
//        
//        return viewheade;
//        
//    } else {
//        UIView *viewheade = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 65)];
//        viewheade.backgroundColor = [UIColor whiteColor];
//        
//        
//        NSArray *array = @[@"youxiang_dating",@"kaifubia",@"home_QCb3"];
//        CGFloat jiajue  = (kScreenW - 110 * 3-28)/2;
//        for (int i = 0; i < array.count; i++) {
//            
//            UIImageView *imaview = [[UIImageView alloc]initWithFrame:CGRectMake(110*i+jiajue*i+14, 5, 110, 55)];
//            imaview.image = [UIImage imageNamed:array[i]];
//            [viewheade addSubview:imaview];
//            
//        }
//        
//        return viewheade;
//    }
//    
//    
//    
//    
//    
//}
//
//- (void)selectedTap:(UIButton *)sender {
//    
//    [self.xuanzhongBut setTitleColor:RGB(51, 51, 51) forState:UIControlStateNormal];
//    //[self.xuanzhongBut setBackgroundImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
//    
////    [sender setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
////    [sender setBackgroundImage:[UIImage imageNamed:@"QCxuanzhong"] forState:UIControlStateNormal];
//    self.xuanzhongBut = sender;
//    self.xuanzhongTag = (int)sender.tag;
//    [self.mainaTableVie reloadData];
//    
//    
//}
//
//
//
//
////- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
////
////    UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 0.01)];
////    footerView.backgroundColor = [UIColor whiteColor];
////    return footerView;
////
////}
//
//
//#pragma mark  ------------  计算文字的高度
//
//
//- (CGFloat)calculateRowHeight:(NSString *)string fontSize:(NSInteger)fontSize
//
//{
//    
//    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]};
//    
//    CGRect rect = [string boundingRectWithSize:CGSizeMake(kScreenW-36, MAXFLOAT)/*计算高度要先指定宽度*/ options:NSStringDrawingUsesLineFragmentOrigin |
//                   
//                   NSStringDrawingUsesFontLeading attributes:dic context:nil];
//    
//    return rect.size.height;
//    
//}
//
//- (void)xuazhongTag:(int )tap {
//    
//    
//     //  self.listArr = @[@"微信",@"朋友圈",@"QQ",@"QQ空间"];
//    
//    
//    
//    
//    
//    
//    if (tap == 0) {
//           // 微信
//          SDWebImageManager *manager =[SDWebImageManager sharedManager];
//             //根据URLString去下载图片
//              NSString *URLString =   self.topModel.icon ;
//             __weak typeof(self) weakSelf = self;
//          
//               [manager loadImageWithURL:[NSURL URLWithString:URLString] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
//                   
//               } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
//                   
//                   if (finished) {
//                       
//                       NSLog(@" shuju %@",image);
//                       
//                       
//                       
//                       NSString *utf8String =[NSString stringWithFormat:@"%@?ct=shouyou&ac=info&gid=%@&language=%@",[HWGlobalConst baseUrl],self.topModel.id,[HWjianzhiduiObject returnLanguageAcquisition]];
//                       
//                      // NSString *utf8String1 = [NSString stringWithFormat:@"%@?ct=shouyou&ac=info&gid=%@",[HWGlobalConst baseUrl],self.mowanDic[@"id"]];
//                       
//                       
//                       
//                       
//                             NSString *title =self.topModel.name;
//                             NSString *description = [NSString stringWithFormat:@"%@%@",self.topModel.name,self.topModel.type];
//                             
//                             //创建发送对象实例
//                             SendMessageToWXReq *sendReq = [[SendMessageToWXReq alloc] init];
//                             sendReq.bText = NO;//不使用文本信息
//                             sendReq.scene = 0;
//                             // 发送到聊天界面  0
//                             // 发送到朋友圈    1
//                             // 发送到微信收藏  2
//                             //创建分享内容对象
//                             WXMediaMessage *urlMessage = [WXMediaMessage message];
//                             urlMessage.title = title;//分享标题 urlMessage.description = @"";
//                             urlMessage.description= description;
//                             
//                             //分享描述
//                             [urlMessage setThumbImage:image];
//                             //分享图片,使用SDK的setThumbImage方法可压缩图片大小
//                             //创建多媒体对象
//                             WXWebpageObject *webObj = [WXWebpageObject object];
//                             webObj.webpageUrl = utf8String;//分享链接
//                           
//                             //完成发送对象实例
//                             urlMessage.mediaObject = webObj;
//                             sendReq.message = urlMessage;
//                             //发送分享信息
//                             [WXApi sendReq:sendReq];
//                       
//                       
//                       
//                       
//                       
//                       
//                       
//                   }
//                   
//                   
//               }];
//          
//          
//          
//          
//      } else if (tap == 1) {
//          // 朋友圈
//          
//          
//          SDWebImageManager *manager =[SDWebImageManager sharedManager];
//               //根据URLString去下载图片
//                NSString *URLString = self.topModel.icon;
//               __weak typeof(self) weakSelf = self;
//                 [manager loadImageWithURL:[NSURL URLWithString:URLString] options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
//
//                 } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
//
//                     if (finished) {
//
//                         NSLog(@" shuju %@",image);
//
//
//
//                               NSString *utf8String = [NSString stringWithFormat:@"%@?ct=shouyou&ac=info&gid=%@&language=%@",[HWGlobalConst baseUrl],self.topModel.id,[HWjianzhiduiObject returnLanguageAcquisition]];
//                               NSString *title = self.topModel.name;
//                               NSString *description = [NSString stringWithFormat:@"%@%@",self.topModel.name,self.topModel.type];
//
//                               //创建发送对象实例
//                               SendMessageToWXReq *sendReq = [[SendMessageToWXReq alloc] init];
//                               sendReq.bText = NO;//不使用文本信息
//                               sendReq.scene = 1;
//                               // 发送到聊天界面  0
//                               // 发送到朋友圈    1
//                               // 发送到微信收藏  2
//                               //创建分享内容对象
//                               WXMediaMessage *urlMessage = [WXMediaMessage message];
//                               urlMessage.title = title;//分享标题 urlMessage.description = @"";
//                               urlMessage.description= description;
//
//                               //分享描述
//                               [urlMessage setThumbImage:image];
//                               //分享图片,使用SDK的setThumbImage方法可压缩图片大小
//                               //创建多媒体对象
//                               WXWebpageObject *webObj = [WXWebpageObject object];
//                               webObj.webpageUrl = utf8String;//分享链接
//
//                               //完成发送对象实例
//                               urlMessage.mediaObject = webObj;
//                               sendReq.message = urlMessage;
//                               //发送分享信息
//                               [WXApi sendReq:sendReq];
//
//
//
//
//
//
//
//                     }
//
//
//                 }];
//          
//          
//      }else if (tap == 2) {
//           //QQ
//          
//          
//          NSString *utf8String = [NSString stringWithFormat:@"%@?ct=shouyou&ac=info&gid=%@&language=%@",[HWGlobalConst baseUrl],self.topModel.id,[HWjianzhiduiObject returnLanguageAcquisition]];;
//               NSString *title = self.topModel.name;
//          NSString *description = [NSString stringWithFormat:@"%@%@",self.topModel.name,self.topModel.type];
//
//               NSString *previewImageUrl = self.topModel.icon; ;
//               QQApiNewsObject *newsObj = [QQApiNewsObject
//                                           objectWithURL:[NSURL URLWithString:utf8String]
//                                           title:title
//                                           description:description
//                                           previewImageURL:[NSURL URLWithString:previewImageUrl]];
//                req = [SendMessageToQQReq reqWithContent:newsObj];
//          
//
//                QQApiSendResultCode sent = [QQApiInterface sendReq:req];
//          
//          
//          
//          
//          
//      }else if (tap == 3) {
//          
//           //QQ空间
//          NSString *utf8String = [NSString stringWithFormat:@"%@?ct=shouyou&ac=info&gid=%@&language=%@",[HWGlobalConst baseUrl],self.topModel.id,[HWjianzhiduiObject returnLanguageAcquisition]];
//               NSString *title = self.topModel.name;
//           NSString *description = [NSString stringWithFormat:@"%@%@",self.topModel.name,self.topModel.type];
//
//          NSString *previewImageUrl = self.topModel.icon;
//          QQApiNewsObject *newsObj = [QQApiNewsObject
//                                           objectWithURL:[NSURL URLWithString:utf8String]
//                                           title:title
//                                           description:description
//                                           previewImageURL:[NSURL URLWithString:previewImageUrl]];
//                req = [SendMessageToQQReq reqWithContent:newsObj];
//          
//
//             //    QQApiSendResultCode sent = [QQApiInterface sendReq:req];
//          
//          QQApiSendResultCode sent = [QQApiInterface SendReqToQZone:req];
//          
//          
//          
//          
//      }
//      
//      
//    
//    
//    
//    
//}
//
//
//
//
//// 点击收藏按钮
//- (void)shoucangcollection {
//    
//    NSString *uid = [HWLocallyStoredData getLoginUserID];
//    NSString *tString = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
//    NSString *gidStr = [NSString stringWithFormat:@"%@",self.gameId];
//    NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uid,tString,@"fsd213ewdsadqwe2121213edsad"];
//    NSString *signMD5 = [WMUtil md5HexDigest:signStr];
//    
//    NSString *type = @"0";
//
//    NSDictionary *parametes = @{
//                      @"uid":uid,
//                      @"t":tString,
//                      @"sign":signMD5,
//                      @"id":gidStr,
//                      @"type":type,
//                      @"ios" : @"1",
//                      @"ct":@"app",
//                      @"type":@"0",
//                      @"ac":@"shoucang_add"};
//    
//    
//    
//    
//      
//    
//    
//    [MBProgressHUD show:@"正在收藏"];
//
//    [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
//        
//       
//        
//        NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//        
//        if ([codeStr intValue] == 1) {
//           // [MBProgressHUD showMessage:@"收藏成功" toView:self.view];
//            
//            [MBProgressHUD showSuccess:@"收藏成功"];
//             self.shouCangBut.selected = YES;
//            [self topGameDetails];
//            
//            
//          
//        } else {
//            
//            
//           // [MBProgressHUD showError:@"收藏失败"];
//           [MBProgressHUD showError:response[@"message"]];
//            
//        }
//     
//        
//        
//    } failure:^(NSString *error) {
//       
//        
//        [MBProgressHUD showError:@"收藏失败"];
//        
//    }];
//    
//       
//    
//    
//    
//    
//}
//// 取消收藏
//
//- (void)quexiaoCollection {
//    
//    
//    
//    
//      NSString *uid = [HWLocallyStoredData getLoginUserID];
//      NSString *tString = [NSString stringWithFormat:@"%ld",[WMUtil getTimeSp]];
//      NSString *signStr = [NSString stringWithFormat:@"%@%@%@",uid,tString,@"fsd213ewdsadqwe2121213edsad"];
//      NSString *signMD5 = [WMUtil md5HexDigest:signStr];
//      NSString *idStr = self.topModel.shoucang_id;
//    
//     
//      
//      
//      
//      NSDictionary *parametes = @{
//                        @"uid":uid,
//                        @"t":tString,
//                        @"sign":signMD5,
//                        @"id": idStr,
//                        @"ios" : @"1",
//                        @"ct":@"app",
//                        @"type":@"0",
//                        @"ac":@"shoucang_del"};
//    
//    
//       
//       
//       
//       [MBProgressHUD show:@"取消收藏"];
//
//       [HWWebUtils doGetWithParameters:parametes progress:nil success:^(id response) {
//           
//          
//           
//           NSString *codeStr =  [NSString stringWithFormat:@"%@",response[@"code"]];
//           
//           if ([codeStr intValue] == 1) {
//              // [MBProgressHUD showMessage:@"收藏成功" toView:self.view];
//               
//               [MBProgressHUD showSuccess:@"取消收藏成功"];
//               self.shouCangBut.selected = YES;
//               [self topGameDetails];
//               
//             
//           } else {
//               
//               
//              // [MBProgressHUD showError:@"收藏失败"];
//              [MBProgressHUD showError:response[@"message"]];
//               
//           }
//        
//
//       } failure:^(NSString *error) {
//          
//           
//           [MBProgressHUD showSuccess:@"取消收藏失败"];
//           
//       }];
//    
//    
//    
//    
//    
//    
//    
//    
//    
//}
//
//
//
//- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
//    
//    NSLog(@"变化 %f ---- %f",scrollView.contentOffset.x,scrollView.contentOffset.y);
//    
//    if (scrollView.contentOffset.y  > 100 ) {
//        
//        self.daohaView.hidden = NO;
//        self.biatiuLabe.textColor = RGB(51, 51, 51);
//        
//        [self.fanhuiBut setImage:[UIImage imageNamed:@"detailshei_back"] forState:UIControlStateNormal];
//        
//        
//        
//    } else if (scrollView.contentOffset.y  < 5) {
//        
//        
//        
//         self.daohaView.hidden = YES;
//        
//         [self.fanhuiBut setImage:[UIImage imageNamed:@"details_back"] forState:UIControlStateNormal];
//         self.biatiuLabe.textColor = RGB(255, 255, 255);
//        
//        
//    }
//    
//    
//}
//
////重新计算高度 类容
//- (CGFloat)jisuncalculateRowHeight:(NSString *)string fontSize:(NSInteger)fontSize
//
//{
//    
//    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]};
//    
//    CGRect rect = [string boundingRectWithSize:CGSizeMake(kScreenW-40, MAXFLOAT)/*计算高度要先指定宽度*/ options:NSStringDrawingUsesLineFragmentOrigin |
//                   
//                   NSStringDrawingUsesFontLeading attributes:dic context:nil];
//    
//    return rect.size.height;
//    
//}
//
//@end

